Compartilhar via


Error: Debugging Isn't Possible Because a Kernel Debugger is Enabled on the System

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

When you debug managed code, you might receive the following error message:

Debugging isn't possible because a kernel debugger is enabled on the system

This message occurs when you try to debug managed code:

  • on a Windows 7 or Windows Vista system that has been started in debug mode.

  • the application uses the CLR version CLR 2.0, 3.0, or 3.5.

Solution

To fix this problem

  • Upgrade your application to use CLR version 4.0 or 4.5

    —or—

  • Disable kernel debugging and debug in Visual Studio.

    —or—

  • Debug using the Kernel Debugger instead of Visual Studio.

    —or—

  • In the Kernel Debugger, disable user-mode exceptions.

To disable kernel debugging in the current session

  • At the command prompt, type:

    Kdbgctrl.exe -d
    

To disable kernel debugging for all sessions (Windows Vista and Windows 7)

  1. At the command prompt, type:

    bcdedit /debug off
    
  2. Restart the computer.

To disable kernel debugging for all sessions (other Windows operating systems)

  1. Locate boot.ini on your system drive (usually C:\). The boot.ini file might be hidden and read-only. Therefore, you must use the following command to see it:

    dir /ASH
    
  2. Open boot.ini using Notepad and remove the following options:

    /debug
    /debugport
    /baudrate
    
  3. Restart the computer.

To debug with the Kernel Debugger

  1. If the Kernel Debugger is hooked up, you will see a message that asks whether you want to continue to debug. Click the button to continue.

  2. You might get a User break exception(Int 3). If this occurs, type the following Kernel Debugger command to continue to debug:

    gn

See also