Welcome to MSDN Blogs Sign in | Join | Help

Bertan's Blog

Developer @ Developer Solutions
Debugging Visual Studio Add-Ins

Although developing Visual Studio Add-Ins has become much easier with Visual Studio 2005, debugging the add-in you are developing can still be difficult. This is because your add-in is loaded each time you open Visual Studio so in order to be able to build the add-in, you have to disable the add-in first making it a fairly difficult and tedious process. Fortunately, we can take a hint from how you would debug VSIP packages if you were developing one.

If you are developing a VSIP package, VSIP project adds relevant package information to a separate experimental hive in the registry thus the instance of Visual Studio you are developing your VSIP package never runs your libraries and you can always build them. We can do the same thing for add-ins as well, first of all you need a separate experimental hive. You can easily do this by installing Visual Studio SDK or copying all of HKLM\Software\Microsoft\VisualStudio\8.0 registry branch to HKLM\Software\Microsoft\VisualStudio\8.0Exp.

Once you have the experimental hive (8.0Exp), go to Automation Options\LookInFolders under that hive and add a new directory. For example I added "%VSMYDOCUMENTS%\TestAddins". This will be directory where you put add-in descriptor files for the add-ins you are developing. Now open your add-in project and go to Debug properties to modify start action. If you have not modified the project before, start action should be set to "Start external program" and devenv.exe should be the program selected. If this is the case, add "/rootSuffix Exp" to command line arguments which will cause Visual Studio instance to use the experimental hive we just created thus loading your add-in. Since your add-in is not loaded with other instances of Visual Studio, you can now build it without worrying about add-in files being in use.

Posted: Wednesday, December 06, 2006 10:34 PM by bertaygu
Filed under: ,

Comments

Anonymous comments are disabled
Page view tracker