This post originated from an RSS feed registered with .NET Buzz
by Scott Hanselman.
Original Post: How to turn off/disable the .NET JIT Debugging Dialog
Feed Title: Scott Hanselman's ComputerZen.com
Feed URL: http://radio-weblogs.com/0106747/rss.xml
Feed Description: Scott Hanselman's ComputerZen.com is a .NET/WebServices/XML Weblog. I offer details of obscurities (internals of ASP.NET, WebServices, XML, etc) and best practices from real world scenarios.
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.
If value = 0, prompt the user by means of a message box. The choices are:
Continue. This results in a stack dump and process termination.
Attach a debugger. In this case, the runtime spawns the debugger listed in the DbgManagedDebugger registry
key. If none, control is returned, and the process is terminated.
If value = 1, simply return control. This results in a stack dump, after which
the process is terminated. (No more dialog)
If value = 2, spawn the debugger listed in the DbgManagedDebugger registry
key.
Option 2: If you want to disable the JIT debug dialog, but still
want an error dialog:
Visual Studio.NET|Tools|Options|Debugging|Just-In-Time and deselect "Common Language
Runtime" and now you’ll get an OK/Cancel dialog instead of the select a Debugger Dialog.
Note: The registry entry from Option 1 above will need to be 0 for the dialog
to show up.
Thanks to Eric Deslauriers of Corillian QA for these tips!