Debugger Type = Auto for C++ projects

We frequently get support calls due to breakpoints not being hit. There are lots of possible reasons why this can occur. Today I would like to talk about one of those – using the 'auto' debugger type. Here is the basic idea of how auto works:

Open the debuggee as a file
Crack the image file headers
Look for the IMAGE_COR20_HEADER

If the IMAGE_COR20_HEADER directory is there, and the flags have COMIMAGE_FLAGS_ILONLY set, then we only debug the managed code in the process. This is what happens for your C#/VB applications.

If the IMAGE_COR20_HEADER directory is there, but the IL ONLY flag isn't set, then we do mixed mode debugging. This is what happens for a Managed C++ application.

If the IMAGE_COR20_HEADER directory is not there at all, then we do native only debugging. This is what happens for everything else.

'Auto' gets users into trouble when they are trying to set breakpoints in dlls. Since auto only looks at the exe, it doesn't care that you are using a managed dll from a native only exe – you are still going to do native only debugging. My suggestion is to not use 'auto', but rather manually pick the debugger type.

Steve commented on this as well (


Comments (5)
  1. Claus Brod says:

    Thanks for the explanation! We have an unmanaged app which loads the CLR at runtime to run some managed code. In that scenario, we always get ‘Auto’ as the default debugger type, although we certainly want ‘Mixed’ instead.

    Is there a way to change the default for the debugger type to "Mixed"? Some magic registry key, maybe? (Yes, I know you can change it in a project, but that’s not what I’m looking for.)


  2. Gregg Miskelly says:

    The debugger team doesn’t actually own this code, so I am not the most definative expert on this subject, but it doesn’t look like it. You could try Peter ( He could tell you for sure.

Comments are closed.

Skip to main content