I've written a C# application, where much of the work is done in a C++ back-end. Now I've been actively developing both sides, and the current iteration of the back end throws an access violation in a specific function. How can I go and debug this? VS won't break on exceptions or breakpoints in native code, nor show the call stack or locals of the native code, even though both projects are built in the same solution. I'd rather avoid having to go back and litter all my native code with logging statements.
For Visual Basic, select Debug in the left pane, select the Enable native code debugging check box, and then close the properties page to save the changes. Select Debug in the left pane, select the Enable native code debugging check box, and then close the properties page to save the changes.
Managed debugging assistants (MDAs) are debugging aids that work with the common language runtime (CLR) to provide information on runtime state. The assistants generate informational messages about runtime events that you cannot otherwise trap.
Select Debug > Start Debugging, or press F5. The app starts in debug mode, and pauses at the breakpoint. While in break mode, open the Threads window by selecting Debug > Windows > Threads. You must be in a debugging session to open or see the Threads and other debugging windows.
VS will debug the native code, too, if you switch on mixed-mode debugging (and recompile your project).
See the Microsoft's explanation: http://msdn.microsoft.com/en-us/library/kbaht4dh.aspx
From Visual Studio 2016
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