I have a solution with ac# win-exe-64 project referencing a c++ (managed,cli,64) library vcxproj. Using Visual Studio 16.10.3.
All works fine and I can use the classes from c++ in c#.
Problem is the debugging, stepping in the c++ code is not working and also breakpoints in the c++ code are not hit. The breakpoints in c++ are showing "Breakpoint will not currently be hit. No symbols have been loaded for this document."
In the ide when I check Modules window, it says: "Symbols loaded" for this specific dll. In the Process window it indicates "Debugging: Managed (.NET 4.x), Native"
I tried so many settings already:
But nothing helps, breakpoints are just not hit.
What also wonders me, "Goto definition" on a c++class member in c#-code just brings the class definitions generated from metadata, it doesn't go to the source.
Any ideas?
Update: the screenshot showing modules-window, dll and pdbs loaded from exe-folder. Right windows main process c# exe calling c++ dll in left window.
There're several possible solutions. Here I'm mentioning some of them which I've come across.
Make sure your VS Solution Configurations is in Debug mode.
Remove all previous debug points. (Debug -> Delete all breakpoints)
Unload the project from VS. (or close VS)
Delete all previous bin, obj, x64/x84 folders from File Explorer.
Open VS and load the project in VS.
Clean project -> Set your debug pointer -> build -> run
Debug -> Options -> General -> Remove the check mark from option " Enable Just My Code "
(It also works in some cases if point 1 & 2 is note enough)
When I faced similar problem, I solved it following point 1 & 2.
For your convenience I'm giving screenshot of my workable VS.
VS Debug -> Options -> General ->
Project Properties -> Build ->
Tutorial: Debug C# and C++ in the same debugging session
Visual Studio lets you enable more than one debugger type in a debugging session, which is called mixed-mode debugging. In this tutorial, you learn to debug both managed and native code in a single debugging session.
May be you are missing something in the step. As per your question please follow the following link.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.