March 03, 2011

Debugging ASP.NET Application events

Lately, I've been working on some ASP.NET sites. I wanted to debug items that get created during the Application.* events (in this case, OnStart specifically).

Sadly, if you just put a breakpoint in the code and hit F5, you get the maddening experience of the debugger not stopping on your breakpoint.

Thankfully, through the magic of System.Diagnostics.Debugger.Break(), you can force a window to popup, asking which version of Visual Studio you want to attach as a debugger!

Happy debugging!