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

Igor Baidiuk 6 Reputation points
2021-03-05T10:23:24.157+00:00

Hello!

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?

Thanks,
Igor

Developer technologies | .NET | .NET Runtime
Developer technologies | Visual Studio | Debugging
Developer technologies | C++
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tianyu Sun-MSFT 34,471 Reputation points Microsoft External Staff
    2021-03-08T07:27:01.897+00:00

    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,
    Tianyu

    • 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.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.