Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtensionManager null in Visual Studio 2017

In previous versions of Visual Studio I could use the following code to retrieve information about a certain installed extension (vsix):

IVsExtensionManager manager = ServiceProvider.GlobalProvider.GetService(typeof(SVsExtensionManager)) as IVsExtensionManager;
if (manager != null)
{
    VsExtension extension = new VsExtension();
    IInstalledExtension info = manager.GetInstalledExtension(cExtensionProductId);
}

In the new Visual Studio 2017 version, the 'manager' variable is always null. Microsoft changed the way to retrieve the information (they no longer use the system registry), but I can't find another way to retrieve the info.

Do you know where I can find more information and/or provide a sample of the new implementation?

Thank you in advance!

like image 894
Odrai Avatar asked Feb 28 '26 16:02

Odrai


1 Answers

Please check that for VS 2017 you are using VS 2017 specific references to the extension manager. It should be Microsoft.VisualStudio.ExtensionManager.dll and Microsoft.VisualStudio.ExtensionEngine.dll.

For a working example see https://vlasovstudio.com/visual-commander/commands.html#ExtensionsList.

like image 169
Sergey Vlasov Avatar answered Mar 03 '26 06:03

Sergey Vlasov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!