Debugging C DLLs called from p/Invoke
Is there anyway to debug into the DLL being called from a p/Invoke interface in C# from VS.NET? It seems it should be possible if there are symbols in the DLL, but I haven't found anyway to do this.
<Debugging Strategies for .NET Developers>
Don't feel like waiting for a book. Give me the cliff notes. If .NET is so easy why do I need a book (http://www.baus.net/archives/000107.html) to do anything?
There's an option in your project properties (Configuration Properties\Debugging\Enable Unmanaged Debugging) to be enabled.
If this dll was a VC 6 DLL. Simply run the exe. Run MSVC 6 and chose Build-Start Debug-Attach to Process and select your exe. You will be able to then be able set breakpoints and you will get called when the function is called.
Forgot to mention. When exiting you can save the debug session. Now you can just run it with this newly created project. (Make sure you add your dll's in the "Additional DLL" list so that way your symbols will be loaded at startup and you wont have to worry about resetting your breakpoints.)
The DLL is written C and has been built with VC++ 7.1. I am able to debug if it is in process (ie a console app), but if I try to attach to the asp.net process, the asp.net process crashes before I can trace into it.
I found this link:
Fog Creek Home