schlebe
schlebe

Reputation: 3715

On Visual Studio 2019, how to debug pure C++ and CLI C++ in a C++ Debug program?

I want to debug a C++ MFC/CLI program developped on Visual Studio 2019.

Until now, I can debug C++ native (MFC) code.

DebugType in Debug panel is set to Auto.

All breakpoints in C++/CLI modules are flagged as inactive (a red circle with an interrogation character in a yellow triangle).

After having changed DebugType from Auto to 'Mixed (.Net Framework), Visual Studio, when starting a debug session, is displaying following warning box.

enter image description here

But my build is in DEBUG mode !

What is happening ?

What must I do to debug pure C++ AND CLI C++ code ?

PS: I have also tried to debug in only C++/CLI code, but Visual Studio 2019 is displaying same message !

Upvotes: 1

Views: 1049

Answers (2)

FranciscoNabas
FranciscoNabas

Reputation: 526

I'm putting this here because it might help someone in the future, and because it's completely nuts.
I've followed all instructions I could find, including the ones on this question, reinstalled VS twice, with different versions, and nothing.
What solved for me was to simply delete the lines of code and write them again.
Yes.
I know.

Upvotes: 2

Mr Qian
Mr Qian

Reputation: 23790

On Visual Studio 2019, how to debug pure C++ and CLI C++ in a C++ Debug program?

Since I do not have your project and cannot troubleshoot the issue quickly unless you provide a sample.

You can try the following suggestions:

Suggestions

1) try to reset all settings by Tools-->Import and Export Settings-->Reset All Settings

2) disable any third party extensions under Extensions-->Manage Extensions in case one of them causes the behavior.

3) check Use Managed Compatibility Mode option, Enable .NET Framework source stepping option and Suppress JIT optimization on module load (Managed only) option under Tools-->Options-->Debugging-->General.

4) close VS, delete .vs hidden folder, Debug folder from the solution folder and also Debug folder in the project folder. Then restart your project to test again.

Upvotes: 3

Related Questions