Saturday, 21 March 2015

Debugging a Visual Studio Addin

Some time ago (1-2 years) I extended Microsoft Visual Studio 2010 for some custom functionality. I chose to create an Add-In which hooks a command into the solution explorer's context menu, execute some command action and provide user feedback via the output view and error list view.

Recently, I had to update this behaviour, which was quickly done. However, the thing that took me the longest was to find out again how to debug the Add-In from Visual Studio 2010. So primarily for myself :) I want to document the required steps in the following.

How to debug Visual Studio Add-In 

  1. Open your Add-In solution in Visual Studio 2010 
  2. Right mouse click the Add-In project file (.prj) and mark it as "startup project"
  3. Open project properties for your Add-In project. On tab Debug in section Start external program select the devenv.exe from your Visual Studio install
    Visual Studio 2010 project properties
  4. In section command line arguments use /resetaddin yourAddin.addin to force complete (re)initialisation of your Add-In 
  5. Copy your Add-In file (.AddIn) to Visual Studio 10's Add-In folder (i.e.  c:\users\<localuser>\Documents\Visual Studio 10\adddins)
  6. In the copied addin file use the <Assembly> tag to point to the Debug directory of your Add-In project.
  7. Run debug command for your Add-In project from Visual Studio 2010

Links


No comments:

Post a Comment