How to step into C/C++ DLL from C# application while debugging
Asked Answered
K

2

28

I have two project in my solution: C/C++ Win32 DLL and some C# application.

What I have to do to be able to step into DLL while debugging?

I switched on all debugging options in C++ project's settings and copied to C# application root next files: MyLib.dll, MyLib.pdb, vc90.pdb, vc90.idb, but it doesn't helped.

What additional actions have I to carry out?

Kessinger answered 19/4, 2009 at 14:21 Comment(0)
E
45

Have you turned on Enable Unmanaged Code Debugging in your C# project?

Emmeram answered 19/4, 2009 at 14:35 Comment(3)
Thank you thank you thank you. Oh, I don't even want to think about how much time I've spent looking for this on my own.Lentil
VS2012 (and probably VS2010 update): the option is now named Enable native code debugging it is still the first option below Enable DebuggersDael
As an add-on, you need to set this option both on the c# project from where the pinvoke function is called and also on the managed entry point (project) of your application.Inn
P
10

If you are attaching a debugger through Debug > Attach To Process, before clicking "Attach" in the "Attach to Process" dialog, make sure to select the appropriate code type to which the debugger can be attached.

enter image description here

Peppery answered 27/8, 2012 at 3:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.