Thursday, June 26, 2008 4:32 PMI have 3 projects:
-one in C#
-one in C++ managed (MC++)
-one in C++ unmanaged (C++).
(MC++) Wraps (C++) so it can be used by (C#).
(MC++) and (C++) are compiled in a separate solution than (C#), so C# refers to (MC++) as an external assembly and (C++) Dll and PDB files are copied in the (C#) bin using a post build event.
When debugging, I can trace into (C#) and (MC++) without no problem, but when trying to step into a function of (C++), it steps over it, so I cannot trace into (C++).
All 3 projects have debugging information generation set on and I can see pdb files are being created:
-The (C#) Debug info setting is set to "Full".
-The (MC++) Debug Information Format is set to "Program Database (/Zi)" and GenerateDebug Info is set to "Yes (/DEBUG)"
-The (C++) Debug Information Format is set to "Program Database (/Zi)" and GenerateDebug Info is set to "Yes (/DEBUG)"
I also tried the Debuggable Assembly setting to "Runtime tracking and disable optimizations (/ASSEMBLYDEBUG)" on both (MC++) and (C++).
I also turned on "Enable unmanaged code debugging" on in (C#).
What am I missing? Is there a way for me to be able to trace in (C++)?
Thursday, June 26, 2008 7:41 PMModerator
Under Tools.Options dialog, select the Debugging category, and make sure the "Enable Just My Code" setting is unchecked.
From the Project properties, select the Debug tab, and then ensure that "Enable unmanaged code debugging" is checked.
Once you've got these squared away, you should get the mixed mode debugging support working.
Also, if you use "Debug.Attach To Process" , be sure to hit the "Select..." button in the "Attach To Process" dialog, and select both Managed and Native debugging support.
Thursday, June 26, 2008 9:30 PMEd Dore, You are my new God.
Thank you so much.
I also noticed "Enable Unmanaged Code Debugging" has to be activated on the StartUp Project that is used for debugging, not on the project using the unmanaged code.
- Edited by Sylvain Boissé Thursday, June 26, 2008 9:34 PM Added comment about startup project.
Monday, September 28, 2009 8:07 PMI tried these suggestions and still couldn't step into unmanaged code until I noticed that the .PDB file was out of date, and updated it. (The framework really should give warnings when these problems occur, instead of silently malfunctioning, collectively wasting man-years among the user community. Microsoft...)
Thursday, June 10, 2010 9:13 AM
Hello Ed Dore,
I am facing similar problem as stated by Sylvain. Could you please guide me? Do I need to do Debug.Attach to process step?
Thnaks in advance.