How to programmatically enable visual studio extension

佐手、 提交于 2019-12-24 01:55:20

问题


I have created a visual studio extension and have packaged it in visual studio setup. Now, when i install the setup, the vsix gets installed and is also seen in the Extension manager window, but its in disabled state. I have tried methods like adding registry entry for the extension and etc... but same was not useful.


回答1:


You should add ProvideAutoLoad attribute to your package class and specify UI context when it's going to load. For auto-load vsix you should write sthm like this:

[ProvideAutoLoad(VSConstants.UICONTEXT.NotBuildingAndNotDebugging_string)]
public sealed class MyVSIX : Package


来源:https://stackoverflow.com/questions/13228178/how-to-programmatically-enable-visual-studio-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!