I have a C++ solution. The startup project is an exe. In the solution there are a number C# dlls (targeting .NET Framework 2.0) that are registered for COM interop. When I put a breakpoint in the C# code I get the hollow red breakpoint with "No native symbols in symbol file"
I have tried setting Project Property Pages -> Debugging -> Debugger Type
to Mixed on the start-up project that calls the COM methods.
I have checked Debug -> Windows -> Modules
. It has loaded my dlls, and the symbol status is "No native symbols in symbol file"
.
This is not the end of the world because if I do Debug -> Start Without Debugging
and then Debug -> Attach to Process
, changing the Attach To:
to Managed (v2.0, v1.1, v1.0) code, Native code
. Then I hit breakpoints in both the C++ code and C# code.
So I have my workaround but I reckon if I can do it by attaching to process - I should be able to do it by just debugging.
How can I hit my C# breakpoints by just doing Debug -> Start Debugging
?
Gdb is a debugger for C (and C++). It allows you to do things like run the program up to a certain point then stop and print out the values of certain variables at that point, or step through the program one line at a time and print out the values of each variable after executing each line.
Debugging is a methodical process of finding and reducing the number of bugs (or defects) in a computer program, thus making it behave as originally expected.
A breakpoint, in the context of C#, is an intentional stop marked in the code of an application where execution pauses for debugging. This allows the programmer to inspect the internal state of the application at that point.
I was able to debug my C# dll from a C++ project in VS2008 by doing the following:
In the C++ project's properties, goto Configuration Properties -> Debugging. Set "Debugger Type" to Mixed. "Attach" should be set to No.
In your C# project properties, in the Debug tab, set the "Start External Program" to your C++ project's executable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With