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?

abatishchev
  • 98,240
  • 88
  • 296
  • 433

2 Answers2

45

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

Ilmari Karonen
  • 49,047
  • 9
  • 93
  • 153
billb
  • 3,608
  • 1
  • 32
  • 36
  • 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. – AnnaR Aug 17 '11 at 12:29
  • 4
    VS2012 (and probably VS2010 update): the option is now named `Enable native code debugging` it is still the first option below `Enable Debuggers` – mjv Sep 30 '13 at 21:36
  • 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. – Tyler Durden Jan 02 '14 at 20:34
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

ikh
  • 2,336
  • 2
  • 19
  • 28