Since a few weeks (months?) I've been sometimes getting the following exception after restarting my ASP.NET application inside Visual Studio 2017 / 2019 Enterprise. It only happens when IIS Express was already running my application and I needed to start a new debug session after recompiling.
Whenever this happens, I have to kill IIS Express (taskkill /f /im iisexpress.exe
) and start a new debug session in VS. I can't figure out what triggers this issue. It started happening on VS 2017 Enterprise some day. Maybe because I received some Win10 update? Upgrading to VS 2019 Enterprise didn't solve the problem.
Managed Debugging Assistant 'FatalExecutionEngineError'
Message=Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x45b30496, on thread 0x16b8. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.'
There are some similar issues reported, but either don't resolve my problem or don't apply:
- Managed Debugging Assistant 'FatalExecutionEngineError'
- I'm not using Use Managed Compatibility Mode.
- Managed Debugging Assistant 'FatalExecutionEngineError' 0xc0000005
- IISExpress is set to x64 as the solution is build for x64.
- https://developercommunity.visualstudio.com/content/problem/29782/managed-debugging-assistant-fatalexecutionengineer.html
- Solution targets .Net Framework 4.6.1, not .Net core.
- We don't use EntityFramework.
I had the same exception on VS17, solved it running the IDE as administrator. I know this is not an ideal solution but in my case it was the only one working. Everything else I tried failed. Hope it helps