views:

849

answers:

1

I have a native C DLL being invoked by a C++/CLI object which is the ViewModel for a WPF progam in C#. I want to set breakpoints in the C DLL. When I try to set them they are grayed out and the help balloon says the breakpoint will not currently be hit. No symbols have been loaded for this document.

To get the program to run OK I had to add a custom build step which copies the DLL, PDB, ILK and LIB files to the intermediate directory of the C# main program. I suspect that has something to do with the problem.

When I look in the list of loaded modules (Debug - Windows - Modules), after a point at which I know the DLL has been loaded and some functions in it executed, I don't see the DLL. I see the C# main program and the C++/CLI module which invokes the C DLL.

All these projects are in the same solution - do I need to be running a separate instance of the solution in order to debug the DLL? Ideally I want to be able to debug the native DLL as well as the calling GUI code.

thanks

+3  A: 

Since your entry point in managed code, you'll need to set the following option: In Visual Studio-> entry project -> properties -> Debug -> Enable unmanged code debugging <- checked

Scott Weinstein
Thanks. I hadn't realised I should be looking for a debug property on the main GUI project, although that makes sense now.
Andy Dent