FatalExecutionEngineError after restarting debug session

3

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:

c#
visual-studio
iis-express
visual-studio-debugging
asked on Stack Overflow May 8, 2019 by Bouke

2 Answers

0

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

answered on Stack Overflow May 31, 2019 by refex
0

I'm not sure where I read this, but apparently there was a bug in .NET Framework 4.7.x that caused this issue. Upgrading to .NET Framework 4.8 resolved the issue. (The project continues to target 4.6.2)

answered on Stack Overflow Jul 10, 2019 by Bouke

User contributions licensed under CC BY-SA 3.0