![]() |
||||
|
This article explains how to reset the commands and user interface of a Visual Studio .NET add-in. More Information An add-in typically create its commands when it receives the ext_cm_UISetup flag in the connectMode parameter of the OnConnection method, and this happens only once in the whole lifetime of the add-in. An add-in that uses commands uses a CommandPreload=1 registry entry value (for add-ins using Registry registration) or XML entry (for Visual Studio 2005 add-ins using XML registration). That value indicates to Visual Studio that the add-in uses commands and therefore the ext_cm_UISetup flag should be used once. Visual Studio .NET uses different locations to store if that flag has been already used:
So, you can force a new ext_cm_UISetup phase just by altering the value indicated above. That will not delete the commands of the add-in, though. If you want to completely reset the IDE, you can use the following procedure:
That will delete all the commands of all the add-ins and their permanent commandbars, buttons, etc., resetting also their PreloadAddinState value. So, the next time that the IDE starts, they will receive the ext_cm_UISetup flag. Notice that using the /reset flag causes also some undesirable effects in the IDE since some user customizations are lost too, specially in Visual Studio .NET 2002. Visual Studio 2005 offers a new less drastic method to reset an add-in. To
reset a specific add-in you can use: where Namespace.Class is the fully qualified name of the main class of the add-in (the Connect class). If you create a Visual Studio 2005 add-in and you go to its properties pages, Debug section, you will notice that there is a command line argument of the form /resetaddin MyAddin.Connect. That gives to the add-in the chance of regenerating its commands each time you debug it. You can use this approach to remove the commands of the add-in when it is uninstalled: if you delete the registry entries and/or XML file and then you execute the above statement, the commands of the add-in will be deleted, and since the add-in is uninstalled there will not be a new ext_cm_UISetup phase for it. To reset all add-ins you can use: devenv.exe /resetaddin * Go back to the 'Resources for Visual Studio .NET extensibility' section for more articles like this
You can code, design, locate code and document your apps much faster using VB.NET, C#, C++ or Visual J#:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||