Visual Studio 2019 – msvsmon.exe unexpectedly exited. Debugging will be aborted with .net core 1.1 project

  Uncategorised

We have a .net core 1.1 C# app that we are trying to debug in Visual Studio 2019 16.11.7.
The project is made up of 2 other projects (all debug fine) + one project which fails to debug. The project was working fine until something was updated somewhere and now it throws this error.

I have tried all the below but still get this error

msvsmon.exe unexpectedly exited. Debugging will be aborted

  1. removed Visual Studio 2019 and reinstalled Visual Studio 2019
  2. deleted the vs folder in the project
  3. set the Project debug target to x86
  4. Set a windows defender firewall exemption for both ‘devexe’ and ‘the x64 remote debugger msvsmon.exe’ file
  5. changed the project to debug with ‘Managed Compatibility Mode’
  6. cleared bin folder under debug & release

All the above failed and the error persists. Any advice please?

What I noticed, is if I put a breakpoint on the below code, it starts (code highlighted yellow) but then on F10 after a brief pause, it throws that error.

 var host = new WebHostBuilder()
                .UseKestrel()
                .UseContentRoot(Directory.GetCurrentDirectory())
                .UseStartup<Startup>()
                .UseApplicationInsights()   
                .UseIISIntegration()
                .Build();

            host.Run();

The project runs fine if I choose ‘Start without Debugging’.

Also not sure why the remote debugger is being used – I am doing local debugging. It is deployed up to Azure as a web app service but this error is happening when I locally debug.

Would appreciate any suggestions. Thankyou.

I also see Microsoft was aware of this issue and apparently fixed it in 16.1.4 but this is not the case.

Source: Visual Studio Questions

LEAVE A COMMENT