4
votes

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:

2
Anti-malware is a common cause of FEEE. Gets extra excited when an executable file appears from seeming no-where and starts to do webby things next. So temporarily disable it to see if it is the cause. - Hans Passant
There's no Anti-malware running on the machine. Windows Defender is disabled through local GPO. - Bouke
Malware is a common cause of FEEE. So temporarily disable it to see if it is the cause. Joking aside, do try it on another machine to isolate the cause. - Hans Passant
I'm not the only one in my team experiencing this issue. This Windows VM is only used for development, and I'm pretty sure that there's no malware on it. - Bouke

2 Answers

1
votes

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)

0
votes

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