How to debug
Debugging an add-in for the very first time can be difficult, especially when there’s a COM custom tool involved. Once you follow the following steps, however, you’ll be bending Visual Studio to your will in no time. Use the installer! Even when debugging, you need to use the installer. It takes a few steps, but it’s fullproof and takes care of all the COM registrations, which are critical.
  • Shut down all Visual Studio instances
  • Uninstall dotNails (if installed). If you ever have your dotNails.AddIn file on your hard drive (wherever you installed dotNails), VS will load the add in on launch, and you won’t be able to build.
  • Open up dotNails.sln, dotNails.CustomTool.sln, and dotNails.Installer.sln in three Visual Studios. Any new VS instances will load the add in, but these can now remain open without blocking the build.
  • Build dotNails.sln, dotNails.CustomTool.sln, and dotNails.Installer.sln with all your fancy new code. Build all three, and build the installer last.
  • Run the msi directly from the Installer\Debug folder
  • Configure the dotNails project for debugging
  • Go to the dotNails.sln VS and hit F5
  • A new VS instance will open. Just load a solution and get cracking.

Last edited Nov 30, 2009 at 6:23 AM by timhardy, version 5


No comments yet.