Reputation: 2159
I have an existing C application that I debug in Visual Studio, and I want to access certain library functions in it. When I compile the library from its c++/cli source to a .lib I can compile it with or without clr support (the /clr
flag.)
If I compile the library with clr support, and link it in with the rest of my application, the debugger can no longer stop at specific lines of code that are not in the library compiled with clr support.
If I compile the library without clr support and link against that library, everything works just fine with the debugger.
We need to compile this library with clr support, and I don't want to lose the ability to debug the rest of the program. Can anyone tell me why I lose my debugging ability when linking with the /clr compiled library but not the other one? Does nayone know how to properly compile / link so that I can keep my debugging ability?
Upvotes: 0
Views: 791
Reputation: 2159
Since the new executable contained a mix of native and managed code, you have to attach both types of debuggers to it. In Debug -> Attach to Process... I selected the process as well as the types of debuggers to attach. In this case, managed (v 4.0) and native.
Answered in greater detail here.
Upvotes: 1