How to Enable JIT Debugging in Windows 10 and 11

Visual Studio controls Just-In-Time (JIT) debugging from its Options: go to Tools > Options > All Settings > Debugging > General, select Configure Just-In-Time debugging, and choose the code types, Managed (.NET Framework) or Native. If Visual Studio is gone from the PC but crash prompts still offer a debugger, Microsoft documents a separate registry clean-up, covered further down. Either way, you need administrator rights.

Two reasons people land here

Microsoft’s own definition is short: “Just-In-Time debugging can launch Visual Studio automatically when an app running outside Visual Studio errors or crashes.” That helps two very different readers.

  • You write or test software and want a debugger to open on the failing line when your program crashes outside Visual Studio. Follow the next three sections.
  • You don’t develop anything, but a crash now shows a box asking which debugger to use. You want it gone. Skip to “Turn JIT debugging off”.

Microsoft notes that JIT debugging works for Windows desktop apps. It doesn’t work for Universal Windows apps, or for managed code hosted in a native application, such as visualizers. The steps are the same on current versions of Windows 11 and on Windows 10, but Windows 10 reached the end of support on October 14, 2025, so it no longer gets security updates.

Turn on JIT debugging in Visual Studio

Enabling or disabling JIT debugging writes a machine-wide registry key, which is why Microsoft says you must run Visual Studio as an administrator to change it.

  1. In the Start menu, right-click Visual Studio and choose Run as administrator.
  2. Open Tools > Options (Debug > Options opens the same place).
  3. Expand All Settings > Debugging > General.
  4. In the right pane, select the Configure Just-In-Time debugging link.
  5. In the Visual Studio Debugger Options dialog, under Enable Just-In-Time debugging for these types of code, select Managed (.NET Framework), Native, or both.
  6. Select OK.
Development environment Options dialog on the Debugging Just-In-Time page with Managed, Native and Script code types checked
Choose which code types trigger the Just-In-Time debugger on the Debugging > Just-In-Time page.

The image above shows the older Options layout, where the checkboxes sat on a Debugging > Just-In-Time page and included a Script option. Microsoft’s current instructions list only Managed (.NET Framework) and Native.

If the Just-In-Time setting is missing

The JIT debugger is an optional part of Visual Studio. Open the Visual Studio Installer, choose to modify your installation, and look in Individual components > Debugging and testing. If you don’t have Visual Studio at all, the free Community edition installs through the same installer, as shown in setting up C++ with Visual Studio on Windows 10.

Windows Forms apps need one more setting

By default, Microsoft explains, Windows Forms apps built on .NET Framework “have a top-level exception handler that lets the app keep running if it can recover.” That handler shows its own error box, so the Visual Studio setting alone won’t bring up the debugger. To hand the crash to the JIT debugger instead:

  1. Open the app’s configuration file, <app name>.exe.config, which sits next to the program. In a Visual Studio project this file is generated from App.config when you build.
  2. In the system.windows.forms section, set jitDebugging to true:
    <configuration>
      <system.windows.forms jitDebugging="true" />
    </configuration>
  3. Save the file and run the app again.

Microsoft also allows this setting in machine.config, but that file applies to every .NET Framework app on the PC, so the per-app file is the safer choice. C++ Windows Forms apps also need DebuggableAttribute set to true; Microsoft says compiling with /Zi and without /Og sets it. If an older .NET Framework app won’t start at all, the runtime may be missing; see turning on .NET Framework 2.0 and 3.5.

What you see when an app crashes

  1. The Choose Just-In-Time Debugger dialog opens.
  2. Under Available Debuggers, select New instance of your preferred Visual Studio version or edition, or a copy that is already open.
  3. Select OK. Visual Studio breaks at the exception.

Microsoft adds a security note: when the dialog warns that the code may not be trusted, continue only if you trust the program. To debug a program that is running but hasn’t crashed, use Debug > Attach to Process (or Ctrl + Alt + P) instead. Once you are in the editor, shortcuts such as commenting out several lines in Visual Studio help when you test a fix.

When the debugger doesn’t start

Microsoft’s troubleshooting section lists these causes. Two of them involve adding registry values. Back up the registry and sign in as an administrator first; Microsoft’s debugging documentation warns that improper registry changes “may not allow Windows to boot.”

What happens What Microsoft says to do
No dialog appears and the app just closes A known Windows issue: add a DWORD value named Auto with value data 1 to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug (Microsoft labels this key .NET) and HKEY_LOCAL_MACHINE\Software\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug (labelled .NET Framework).
Windows Error Reporting handles the crash instead Add a DWORD value named Disabled with value data 1 under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Windows Error Reporting (for 32-bit apps on 64-bit Windows, also under the matching WOW6432Node key).
“Another debugger has registered itself as the Just-In-Time debugger” Enable JIT debugging again in Visual Studio as administrator, or repair Visual Studio.
“Class not registered” Repair Visual Studio from the Visual Studio Installer.
“Registration errors detected” or “Access is denied” Run Visual Studio as administrator until the registration is fixed.

All of this is on Microsoft’s page Debug using the Just-In-Time Debugger in Visual Studio. If you just need to know why a program crashed rather than step through it, checking the Windows event log is usually quicker.

Use WinDbg as the postmortem debugger

Developers who prefer WinDbg can make it the debugger Windows starts on a crash. Microsoft’s postmortem debugging page documents this for WinDbg from the Debugging Tools for Windows:

  1. Open Command Prompt as administrator.
  2. Go to the WinDbg folder, for example C:\Program Files (x86)\Windows Kits\10\Debuggers\x64.
  3. Run windbg -I (capital I). Microsoft says it “will display a success or failure message”.
  4. Repeat from the x86 folder, because 32-bit programs need a 32-bit postmortem debugger.

Microsoft’s page covers this classic WinDbg; it doesn’t describe the same steps for the newer WinDbg app, so check that app’s own documentation. For reading crash dumps after the fact, see reading minidump files.

Turn JIT debugging off

While Visual Studio is installed

Run Visual Studio as administrator, return to the Visual Studio Debugger Options dialog described above, clear Managed (.NET Framework) and Native, and select OK. Remove any jitDebugging line you added to a Windows Forms config file.

After Visual Studio has been uninstalled

Microsoft notes that JIT debugging “might still be enabled even if Visual Studio is no longer installed on your computer,” which is why some PCs keep offering a debugger that isn’t there. Its fix is a registry edit, and the Windows debugging documentation warns that improper registry changes “may not allow Windows to boot.” Back up the registry before you start, and sign in with an administrator account.

  1. From the Start menu, run Registry Editor (regedit.exe).
  2. Locate and delete these entries if they exist:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
    • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger
  3. Also delete these if they exist:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger
  4. Close Registry Editor.

Microsoft’s instruction is explicit: “Make sure not to delete or change any other registry keys.” Delete only those four values, not the AeDebug or .NETFramework keys that contain them.

What the AeDebug values mean

This is reference only, to help you read what Visual Studio or WinDbg wrote. Microsoft’s postmortem debugging page describes the AeDebug key this way:

  • Debugger holds the command line of the debugger Windows starts when a program crashes.
  • Auto set to 0 means “a confirmation message box is displayed” before the debugger starts; set to 1, “the postmortem debugger is immediately created”.
  • On 64-bit Windows, the values for 32-bit programs live under the Wow6432Node copy of the key.

Managed code uses the DbgManagedDebugger value under the .NETFramework key, which is one of the four values Microsoft says to delete after uninstalling Visual Studio.

JIT debugger questions

Why do I get a debugger prompt after uninstalling Visual Studio?

The registry values that point Windows at the debugger can stay behind. Delete the four values Microsoft lists in “After Visual Studio has been uninstalled”, and the prompt should stop.

Is JIT debugging the same as the .NET JIT compiler?

No. The names are similar, but the JIT compiler turns .NET code into machine code as a program runs, while JIT debugging attaches a debugger when a program fails.

Do I need different settings for 32-bit programs?

Often, yes. On 64-bit Windows the 32-bit values sit under Wow6432Node, and WinDbg needs to be registered from both its x64 and x86 folders.

Can I use Visual Studio Code as the JIT debugger?

Microsoft’s JIT documentation covers Visual Studio and, for postmortem debugging, WinDbg. It doesn’t describe Visual Studio Code in that role, so use one of those two.

When you’re done debugging on a PC that other people use, turn JIT debugging back off so a crash closes normally instead of asking for a debugger.