Debug a C++ DLL from a C# Windows app in VS.NET2005

G

Guest

I have been trying to set breakpoints inside a C++ DLL and running a C#
application which calls the exported functions from the C++ DLL. However,
when I run my solution in debug mode it always says

"The breakpoint will not currently be hit. No symbols have been loaded for
this document."

where I haved placed the breakpoint.
In the properties of my C++ app (which is not managed by the way)
Configuration Properties -> Debugging -> Command I have set my C#
application. What more do I need to do?
 
W

William DePalo [MVP VC++]

Joachim said:
I have been trying to set breakpoints inside a C++ DLL and running a C#
application which calls the exported functions from the C++ DLL. However,
when I run my solution in debug mode it always says

"The breakpoint will not currently be hit. No symbols have been loaded for
this document."

where I haved placed the breakpoint.
In the properties of my C++ app (which is not managed by the way)
Configuration Properties -> Debugging -> Command I have set my C#
application. What more do I need to do?

There are a few things that can bite you:

1) Make sure you have one and only one copy of the DLL that you want to
debug where the IDE is likely to find it

2) If you move it from the development directory, make sure you move the PDB
file as well

3) Make sure you have optimizations switched off

4) Make sure you haven't turned off native debugging support as might be the
case by default if you are debugging a C# project

Regards,
Will
 
G

Guest

Thanks Will,

I just solved it myself. This is what I did:

Properties on the C# app
Debug -> Enable unmanaged code debugging
Start the C# app

Regards,
Joachim
 
W

William DePalo [MVP VC++]

Joachim said:
Thanks Will,

You are welcome.
I just solved it myself. This is what I did:

Properties on the C# app
Debug -> Enable unmanaged code debugging
Start the C# app

That's #4 on my list. Managed projects by default have managed debugging
enabled only.

Regards,
Will
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top