By default, when an unhandled exception occurs in a managed application, a dialog box appears that asks you whether you want to debug the application with one of the debuggers that are listed in a listbox. (Notice that Windows Forms applications display a different dialog box.)
The behavior of the .NET framework in this case can be controlled by changing the DbgJITDebugLaunchSetting value following registry key:
HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETFramework
This value can be assigned one of the following three values:0 – a simple message box appears and asks the end user whether to Continue or to Attach a debugger. In the former cases a stack dump is produced and the application terminates. In the latter case the debugger listed in the DbgManagedDebugger registry key is lauched.
1 – the application is terminated and a stack dump is produced.
2 – the debugger listed in the DbgManagedDebugger registry key is lauched.