Fka
Fka

Reputation: 6234

KeyVaultClient throws FatalExecutionEngineError on debug randomly

When I debug ASP.NET MVC application, KeyVaultClient throws randomly exception:

Managed Debugging Assistant 'FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x59eab403, on thread 0x6098. 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.'

I use:

I got familiar with this question and nothing helpful happens.


Edit

After enabling Managed Compatibility Mode I get slightly different error:

Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\Program Files (x86)\IIS Express\iisexpress.exe'. Additional Information: The runtime has encountered a fatal error. The address of the error was at 0x6c0db403, on thread 0x54a8. 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. occurred

Upvotes: 4

Views: 868

Answers (1)

Mohit Verma
Mohit Verma

Reputation: 5296

From https://devblogs.microsoft.com/devops/switching-to-managed-compatibility-mode-in-visual-studio-2013/

New managed debug engine that provides us the ability to more rapidly add new features compared to the older implementation. This can be seen by the number of features introduced in Visual Studio 2013 after only a single year including Managed Return Values, .NET 64-bit Edit and Continue, Async Callstacks Enhancements, and Improved Tasks Window to name a few. Unfortunately, there are still a couple scenarios that are not supported yet with the new debug engine, so in these cases you will have to switch back to the legacy engine.


Error which you are getting is because of the issue which is not supported by new debug engine.

Please try below setting and see if you still get the same error.

  • To switch back to the legacy debug engine globally, select Tools/ Options

  • then check Use Managed Compatibility Mode on the Debugging / General tab.

The global option will force the legacy engine to be used for any launch or attach.

Hope it helps.

Upvotes: 1

Related Questions