Wednesday, March 15, 2006

Enabling JIT-attach Debugging

Enabling JIT-attach Debugging
.NET Framework Developer's Guide
Enabling JIT-attach Debugging

JIT-attach debugging is the phrase used to describe attaching a debugger to an executable image that throws an uncaught exception. In unmanaged code, it is what happens when you see a message box that invites you to:

  • Click OK to terminate the program

  • Click CANCEL to debug the program

If you click CANCEL, a debugger is started and attached to the process. The registry key that controls this is called HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Current Version\AeDebug.

For an application that includes managed code, the common language runtime will present a similar dialog to JIT-attach a debugger. The registry key that controls this option is called HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\DbgJITDebugLaunchSetting.