Syed Aslam Basha here…..I am a tester on the Information Security Tools team. As such I often find myself needing to test new tools being developed that plug-in to Visual Studio. Most of us have probably done some debugging, but debugging an Add-in in Visual Studio poses some challenges.
This is how I do it:
- Delete all bin and obj files
- Copy paste any snk file where it is required
- Set appropriate debug type you want for the project
- Right click on addins project , set “addin project” as startup project
- Right click on “addins project”, select properties and set as shown in the screen shot below
- Set Start external program C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
- Set Command line arguments /resetaddin addin filename
- Set working directory C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
- Create folder addins in C:\Users\syed\Documents\Visual Studio 2008\Addins
- Copy paste the addin definition file and set the parameter <Assembly> as <Assembly>Path to AddIn.dll</Assembly>
- Build solution
At this step you should not be getting any errors.
Launch Visual studio, open your project, set break points and run. One more instance of Visual Studio is launched and as you work with this it would stop at break points and you can debug your addin.
See the screen shots attached.
I am of course interested in hearing if you have an easier way to do it!