Improving Just-In-Time debugging

Just-In-Time (JIT) debugging is what happens when your .NET application has an unhandled exception that bubbles up to the top of the stack and causes a crash (the default behaviour). When a crash occurs, and depending on registry settings, the CLR presents you with a list of debuggers and asks you to choose which one you want to use to investigate the crash.

If your favourite debugger isn't in the list of debuggers presented by the CLR, there's an un-documented and un-supported way to add it to the list. For example, if you sometimes like to use Windbg, the following command line registers Windbg for JIT debugging:

vs7jit.exe /RegisterOld "C:\Windbg\windbg.exe" "Windbg"

To un-register Windbg for JIT debugging, you can use the following command line:

vs7jit.exe /UnregisterOld "C:\Windbg\windbg.exe"

As I've already said, this switch is officially un-documented so I don't know for how long it will continue working.