Partager via


Debugging Addins in Visual Studio

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:

  1. Delete all bin and obj files
  2. Copy paste any snk file where it is required
  3. Set appropriate debug type you want for the project
  4. Right click on addins project , set “addin project” as startup project
  5. Right click on “addins project”, select properties and set as shown in the screen shot below
  6. Set Start external program C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
  7. Set Command line arguments /resetaddin addin filename
  8. Set working directory C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
  9. Create folder addins in C:\Users\syed\Documents\Visual Studio 2008\Addins
  10. Copy paste the addin definition file and set the parameter <Assembly> as <Assembly>Path to AddIn.dll</Assembly>
  11. 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.

clip_image001

I am of course interested in hearing if you have an easier way to do it!

- Syed