Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debugging both managed c# code and unmanaged c++ code in one solution

I have a solution with an unmanaged c++ dll project in it and a c# managed project that calls dll using PInvoke. Is it possible to debug both managed and unmanaged code so that I see what is going on "inside" of that dll?

like image 773
adrin Avatar asked Jul 27 '10 22:07

adrin


People also ask

How do I debug managed code in Visual Studio?

Enable mixed-mode debugging for a managed calling appEnable native code debugging in the properties. For C#, select Debug in the left pane, select Open debug launch profiles UI, then select the Enable native code debugging check box, and then close the properties page to save the changes.

Can you debug C in Visual Studio?

Visual Studio Code supports the following debuggers for C/C++ depending on the operating system you are using: Linux: GDB. macOS: LLDB or GDB. Windows: the Visual Studio Windows Debugger or GDB (using Cygwin or MinGW)


1 Answers

Yup. If I'm not mistaken, it should do this automatically, as long as the profile is set to "Debug".

Edit: Oh, I forgot one thing: In the debugging options for the managed project, make sure you have the option "Enable unmanaged code debugging". Then it should step into the unmanaged code.

like image 130
Mike Caron Avatar answered Nov 14 '22 23:11

Mike Caron