FatalExecutionEngineError after restarting debug session

不羁岁月 提交于 2019-12-01 21:12:18

问题


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.

回答1:


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)




回答2:


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



来源:https://stackoverflow.com/questions/56042920/fatalexecutionengineerror-after-restarting-debug-session

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!