3
votes

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:

  • nuget Microsoft.Azure.KeyVault 3.0.3
  • Visual Studio 2019 Professional 16.1.4
  • Microsoft.AspNet.WebApi 5.2.3
  • don't have Managed Compatibility Mode

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

1

1 Answers

1
votes

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 yous till 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.