Debugging a .NET Framework 2.0/3.0/3.5 class library with VS 2010

A number of people have had difficulty debugging a .NET Framework 2.0/3.0/3.5 class library that loads into a native executable. The debugger will launch, and their code will run, but the debugger will not stop at breakpoints, detect that modules load, etc.

The problem is that the debugger is trying to determine what version of the .NET Framework your class library will load into, and the debugger has guessed incorrectly.

The work around for this is to add a config file next to the native executable to tell the debugger what version of the .NET Framework to debug.

So if you are trying to debug c:\proj\MyNativeProject\debug\MyNativeProject.exe, then create c:\proj\MyNativeProject\debug\MyNativeProject.exe.config with this content:

<?xml version ="1.0"?>
        <supportedRuntime version="v2.0.50727" />

Comments (1)
  1. David Lowndes says:

    Given that the debugger has guessed incorrectly, is this something that you can fix in a service pack or future version, or not?

Comments are closed.

Skip to main content