Annoyed by Visual Studio Just-In-Time Debugger

The purpose of Just-In-Time is to allow you to debug an application who recently crashed while Visual Studio IDE was not launched and configured to debug that particular application.

Much shorter, Just-In-Time is a cool functionality for the developers, but as sysadmin you usually don’t expect and need to deal with Visual Studio Just-In-Time Debugger popup window on production servers. However there are situations when for example a simple SQL Server Management Studio installation on the production server will enable it.

As you can see in the bellow screenshot, I recently encountered it when I manually installed the ​May 2015 CU for Project Server 2013. I didn’t got the DisableJITDebuger.reg with me at that moment and started browse some articles to find out how. Now I post it here and will be more handy next time (as long as I have internet connectivity :) ).
Annoyed_By_Visual_Studio_Just_In_Time_Debugger_01

The bad part with Visual Studio Just-In-Time Debugger is that in some scenarios it can increase your server maintenance time. For example you are manually installing a patch who can get stuck to a phase where … let’s say it requires to communicate with a particular .NET application. If that .NET application crashed and the Visual Studio Just-In-Time Debugger triggered, than your patch installation will probably wait that .NET application to “do something”, but that .NET application is waiting to be debugged. It depends a lot on how well the patch installer is behaving in such situations (either silently continue, or is waiting – case in which no progress will be done until the sysadmin clicks the “No” button of the Visual Studio Just-In-Time Debugger window).
I personally got the situation where I started in parallel the same patch installation and on one server the installation finished, while the other was still in “progress” waiting me with the Just-In-Time Debugger popup window.

The good part is the Visual Studio Just-In-Time Debugger can be disabled and I encourage to do it on the production servers (unless for a well-defined reason debugging is required there).

Visual Studio Just-In-Time Debugger can be disabled from Windows Registry
DisableJITDebuger.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"DbgManagedDebugger"=-
"DbgJITDebugLaunchSetting"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug]
"Debugger"=-

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework]
"DbgManagedDebugger"=-
"DbgJITDebugLaunchSetting"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug]
"Debugger"=-

I am pretty sure you would not need to enable Visual Studio Just-In-Time Debugger back, but just in case somebody needs it…
please adjust the paths according with your OS installation (usually required for dual boot systems)
EnableJITDebuger.reg

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework]
"DbgManagedDebugger"="\"C:\\Windows\\system32\\vsjitdebugger.exe\" PID %d APPDOM %d EXTEXT \"%s\" EVTHDL %d"
"DbgJITDebugLaunchSetting"=dword:00000010

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug]
"Debugger"="\"C:\\Windows\\system32\\vsjitdebugger.exe\" -p %ld -e %ld"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework]
"DbgManagedDebugger"="\"C:\\Windows\\system32\\vsjitdebugger.exe\" PID %d APPDOM %d EXTEXT \"%s\" EVTHDL %d"
"DbgJITDebugLaunchSetting"=dword:00000010

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug]
"Debugger"="\"C:\\Windows\\system32\\vsjitdebugger.exe\" -p %ld -e %ld"