Debugger fatal error when running CMake C++ application with .NET Core DLL

Igor Baidiuk 6 Reputation points


I have native C++ application. Recently I added .Net Core assembly to it which runs through C++/CLI adaptor. After that, I receive following error message whenever I try to start debugging:

A fatal error has occurred and debugging needs to be terminated. The debugger was configured to use the Desktop CLR (NET Framework) Managed debugger, but the target process loaded the CoreCLR (NET Core) runtime. To debug this project, configure it to use the 'Managed (CoreCLR)' debugger.

And VS hangs completely, to the point I need to use task manager to kill it.

I've found only one semi-relevant answer on old MSDN forums where it was recommended to install required .Net Core runtime and enable native debugging. App runs without debugger just fine. so it's not absence of runtime. And I cannot "enable native debugging" since app is alrady native. Removing all .NET development components and reinstalling them doesn't help either.

Does anyone know if/how it's possible to configure managed debugger to resolve this issue?


A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
2,912 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: The period of time during which a program is being executed in a computer.
1,002 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
771 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 16,931 Reputation points Microsoft Vendor

    Hello anonymous userBaidiuk-4715 ,

    Thank you for taking time to post this issue in Microsoft Q&A forum.

    Please kindly check if this option works:

    Project Property > Configuration Properties > Debugging > Debugger Type > choose the appropriate debugger type.

    If this doesn't meet your requirement or fix this error, could you share some simple steps with me to reproduce your issue?

    Best Regards,

    • If the answer is helpful, please click "Accept Answer" and upvote it.
      Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.