Cannot set breakpoints in C DLLs used by C ++ / CLI called from C #

I have a native C DLL called by a C ++ / CLI object, which is a ViewModel for a WPA program in C #. I want to set breakpoints in a C DLL. When I try to set them, they are grayed out and a tooltip tells me that the breakpoint will not be deleted at the moment. No characters have been loaded for this document.

In order for the program to start normally, I had to add a custom build step, which copies the DLL, PDB, ILK and LIB files to the intermediate directory of the main C # program. I suspect this is due to a problem.

When I look at the list of loaded modules (Debug - Windows - Modules), after I know that the DLL is loaded, and some functions are executed in it, I do not see the DLL. I see the main C # program and the C ++ / CLI module that calls the C DLL.

All these projects are in one solution - do I need to run a separate instance of the solution for debugging the DLL? Ideally, I want to be able to debug my own DLL, as well as the calling GUI code.

thanks

+2
source share
1 answer

From the moment you enter the managed code, you need to set the following parameter: In Visual Studio-> login project β†’ properties β†’ Debugging β†’ Enable debugging without changes <- checked

+9

Source: https://habr.com/ru/post/1712359/


All Articles