Debugging C++/Cli: and no Locals

后端 未结 2 908
梦毁少年i
梦毁少年i 2020-12-03 15:05

I am trying to debug a project with a C# assembly and a C++/Cli assembly.

An interface defined in C# is inherited by a C++/Cli class, which in turn calls a native C

相关标签:
2条回答
  • 2020-12-03 15:42

    Unfortunately pieces of the tooling support in VS for C++/CLI projects keep falling off, they are struggling to keep it maintained. There's an issue with the new debug engine added to VS2012, the one that supports the new C++ debugging visualizers, it doesn't support C++/CLI anymore.

    VS2012 Update 1 added a new setting in Tools + Options, Debugging, General, named "Managed C++ Compatibility Mode". Confusingly renamed to "Use Managed Compatibility Mode" in VS2013. Undocumented in the MSDN page for this settings page. What it does is force the debugger to use the old debugging engine instead of the new one.

    This does have a side-effect, those shiny new debugging visualizers won't work when you have the option turned on. Keep this in mind if the debug info for your native code doesn't look right.

    0 讨论(0)
  • 2020-12-03 15:42

    I found the solution: The mixed-mode debugging setting on the projects is not enough alone, in addition, Visual Studio requires enabling

    [x] Use Managed Compatibility Mode
    

    in Tool->Options->Debugging->General.

    0 讨论(0)
提交回复
热议问题