Home > database >  Visual Studio 2019 - msvsmon.exe unexpectedly exited. Debugging will be aborted with .net core 1.1 p
Visual Studio 2019 - msvsmon.exe unexpectedly exited. Debugging will be aborted with .net core 1.1 p

Time:12-01

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.

Before removing &reinstalling Visual Studio 2019, I did a full repair on Visual Studio. That didn't resolve the issue either.

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' (now Disabled)
  6. cleared bin folder under debug & release
  7. setting IIS to debug in 32 mode (but since removed this)
  8. Added 127.0.0 to hosts file (but since removed this)
  9. Installed both 64 bit and 32 bit .Net core 1.1.13 runtimes & SDKS from https://dotnet.microsoft.com/download/dotnet/1.1
  10. updated global.json
{
  "sdk": {
    "version": "1.1.14"   //was ->  "version": "2.1.200"
  }

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. If I put the first breakpoint at host.Run(), it never makes it before that error is shown.

 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 debug locally.

Windows Event viewer shows the exception details but It doesn't explain the actual error:

Faulting application name: msvsmon.exe, version: 16.11.1197.0, time stamp: 0x617c671f
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x00007ffe87713c45
Faulting process ID: 0x174
Faulting application start time: 0x01d7e27b6dad4865
Faulting application path: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Remote Debugger\x64\msvsmon.exe
Faulting module path: unknown
Report ID: 9ae51274-a8b0-4e3d-a067-efbb01da4bab
Faulting package full name: 
Faulting package-relative application ID: 

Would appreciate any suggestions. Thankyou.

I also see Microsoft was aware of this issue and apparently fixed it in VS2019 Update 16.4.4 but this is not the case. https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-v16.4#visual-studio-2019-release-notes-history

I have researched similar scenarios on the net which suggested the options above, but the error persists.

Also I have now tried a different version of this project (older) on my PC (did a git clone) and I get the same error message.

CodePudding user response:

You are already tried the all possible ways to fix the issue. Still it not worked Please try to install the latest visual studio 2022 it has the fix of msvsmon.exe unexpectedly exited.

Once you install the latest version try to run your project and check you can debug your project. Unfortunately this issue can persist in all VS 2019 & some VS 2017 some discussion here . So the only solution is to upgrade your Visual studio latest version.

If still issue persist, please do a below steps and collect dump file.

  1. Start Visual Studio and start debugging your app. You can see msvsmon.exe processes launched while you are in debug mode.

  2. Start another instance of VS.

  3. In the second instance click Debug | Attach to Process…

  4. In the list of processes select msvsmon.exe. You should be able to attach to all of the running instances found in step 1.

  5. Click Select… and explicitly choose 'Native' and 'Managed(v4.6, v4.5, v4.0)' code.

  6. Click OK and OK to close Select dialog and Attach to Process dialog.

  7. Go back to the first instance of VS and repro the crash.

  8. Upon the crash control should go to the second instance of VS.

  9. In the second instance click Debug | Save Dump As… and save the crash information.

  10. Attach the dump file to your problem report and send it

Refer here

After collecting dump, please raise your report here

  • Related