VSIX registration and unregistration issue
-
21-12-2019 - |
سؤال
I'm having some problems when registering and unregistering an extension in Visual Studio 2012 / 2013. The issue is the following:
1.- Register an extension:
vsixinstaller.exe myvsixpackage.vsix
A directory is created in my local folder, under C:\Users\xxx\AppData\Local\Microsoft\VisualStudio\12.0\Extensions.
2.- Unregister the extension:
vsixinstaller.exe /u:myvsixID
This unregisters the extension, but it does not remove the extension assemblies; When I restart Visual Studio and plugins are loaded, the files are removed. It seems that the extensions is marked to be removed later.
3.- Register the extension again.
vsixinstaller.exe myvsixpackage.vsix
I get the error: "This extension is already installed to all available products".
But if I open VS2013 the extension is not there. Eventually I cannot even unregister it (VSIX installer says that the extension was already uninstalled) and I have to remove the directory manually so that I can register my extension again.
Is there any workaround for this? Is it a bug? Am I doing something wrong?
المحلول
It seems that Visual Studio needs to be started in order to refresh all the Extensions registered and unregistered.
The best solution to register / unregister silently is running:
devenv /setup /nosetupvstemplates
After the plugin has been unregistered.
This executes the IDE but not showing it to the user. Perfect for including a Visual Studio Extension in a installer along with your main product, if publishing it in the Visual Studio Gallery is not a good approach.