Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 670
abatishchev Avatar asked Apr 19 '09 14:04

abatishchev


People also ask

How do I Debug a DLL?

Debug from the DLL project Set breakpoints in the DLL project. Right-click the DLL project and choose Set as Startup Project. Make sure the Solutions Configuration field is set to Debug. Press F5, click the green Start arrow, or select Debug > Start Debugging.

How do I Debug a mixed code in Visual Studio?

Select the C++ project in Solution Explorer and click the Properties icon, press Alt+Enter, or right-click and choose Properties. In the <Project> Property Pages dialog box, expand Configuration Properties, and then select Debugging. Set Debugger Type to Mixed or Auto. Select OK.


2 Answers

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

like image 163
billb Avatar answered Oct 04 '22 18:10

billb


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

like image 36
ikh Avatar answered Oct 04 '22 20:10

ikh