Managed Debugging Assistant 'FatalExecutionEngineError' 0xc0000005
Asked Answered
R

2

6

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

This only seems to happen using Asp.Net Core 1.1 and only with entity framework for .net (not EF Core). It also does not happen all of the time, but when it does it's always during an EF call.

I've tried enabling "Use Managed Compatibility Mode" as described here, but it doesn't seem to make a difference.

Rejoinder answered 13/9, 2017 at 20:49 Comment(3)
I'm seeing this problem but only when running using IIS Express. If I just use Kestrel everything seems OK.Natika
I had the same problem. I've fixed it by changing project's Properties/Debug/Web Server Settings/IIS Express Bitness to x64 (instead of Default)Uriiah
This occurs for me running Ibm.data.db2.iSeries when trying to instantiate a new instance of the iDB2Connection ins VS 2017. I have tried building x86 and x64 with no success. This occurred out of the blue.Coronal
K
2

I was getting "FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x72d41302, on thread 0x4520. The error code is 0xc0000005" while running a simple hello world application in Visual Studio 2017.

Resolved the issue by using x64 mode for debug.

Kenakenaf answered 20/4, 2018 at 13:42 Comment(0)
C
0

I had an issue similar to @RedBottleSanitizer, when entering the Main method before the first line was executed it already crashed the debugger of a normal WPF application (using VS2022 Enterprise 17.11.3 and NET 4.8).

To give the runtime a chance to load my Main method, even if some referenced assemblies should be missing, I decided to move its content into a method Main2 and have in the Main method only a call to Main2, wrapped in a try/catch:

[STAThread]
public static void Main(string[] args) {
    try {
        Main2(args);
    } catch (Exception ex) {
        ; //Set break-point here
    }
}

private static void Main2(string[] args) {
    //Original code from main
}

To my astonishment that didn't give me an exception with a better error message but it solved the problem!

Colchicine answered 4/10 at 16:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.