Wednesday, October 24, 2007

Debugging VS.NET Design time

Just came across an excellent article on Brennan's Blog explaining in detail how to setup Visual Studio to enable debugging of design time code. In short here's what it boils down to:
  1. In Visual Studio set the debug properties on the (Class Library) project you want to debug to 'Launch an external program' and make that program Visual Studio. In most cases that would be : C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.exe
  2. Save the properties and setup your breakpoints. Now right click the project and from the popup menu choose Debug > Start new instance.
  3. A new instance of Visual Studio fires op. Now, in the new instance, load a simple project that uses the project you want to debug and you're good to go.
This even helps debug build issues in things like VirtualPathProviders and ResourceProviders. Read the full article

No comments: