How can I configure VisualStudio and/or the CLR-Runtime to properly load the
symbols of dynamically loaded DLLs???
I have a bunch of performance critical C-functions that I need to use from
within my C# application.
All the functions have been put in a DLL and ar imported into the CLR using
[DllImport ("mydll.dll")].
So far, everything works fine, EXCEPT that I cannot set breakpoints in the
DLL code. VisualStudio keeps displaying
the "question mark" breakpoint sign, which signifies, that the debugger
could not load the symbols from the DLL...
This drives me mad, because it means that I essentially have to write all
the code twice: Whenever I suspect a bug in the DLL C-Code I have to convert
the C# code back to C/C++ in order to move it into a nonmanaged project from
where I then can test and debug my DLL.
Any solutions??
matthias
Open up your C (dll) project in Visual Studio 7. Make
sure that the C# program loads the dll from where the C
project builds to. Right click on the project in the
solution explorer, and choose properties from the menu.
On the dialog box that appears, you should see
a "configuration properties" folder on the left. Under
that, click on "Debugging". On the middle-right side of
the dialog, you should now see options. Click on the
value for "Command" and choose "browse" from the pull
down box. Find and select the C# program's executable.
Once you have done this, click apply and ok on the
properties dialog box.
Now, right click on the project again, only this time,
choose "set as startup project".
You should now be setup to run the C# program when you
tell the C project to start. You can put down
breakpoints in the C project where ever you'd like. When
you start the C project in debug mode, your C# program
should run instead. You should find that you have full
debugging capabilities within the C project at this point.
Another (similar) way to be able to use breakpoints in
your C project is to run the C# program manually,
and "attach" to the process from within Visual Studio 7.
You can attach to a running process by clicking the debug-
>processes menu item, finding the process you want to
attach to in the list, and then clicking "attach". When
(and if) the C dll gets loaded from the running process,
the C project will know about it and will hit breakpoints
as usual.
Good luck figuring this out. I hope that this helps!
--->Jon
>.
>