12

I'm getting below error:

Managed Debugging Assistant 'FatalExecutionEngineError' has detected a problem in 'C:\Users\App\App.exe'. Additional Information: The runtime has encountered a fatal error. The address of the error was at 0xf5b029e1, on thread 0x72bc. 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 get the above error when i execute this statement while debugging.

 LoggerHandler.Info("Executed " & iterations.ToString & " iterations on " & max_processors & " cores in " & Format((Now() - time).TotalSeconds, "0.0") & " seconds.")
abdul sammad
  • 141
  • 1
  • 2
  • 7

4 Answers4

11

Changing to use "Managed Compatibility Mode" is what fixed the error for me in Visual Studio 2015:

Tools menu >Options > Debugging > General > "Use Managed Compatibility Mode"

enter image description here

This Microsoft blog describes what this setting does in a bit more detail.

JumpingJezza
  • 5,498
  • 11
  • 67
  • 106
  • 2
    i'm seeing similar errors, and this option not work, can you help take a look here:https://stackoverflow.com/questions/44213605/managed-debugging-assistant-fatalexecutionengineerror-occurred – dingx May 27 '17 at 06:17
  • 2
    I have same errors, when I enable "Use Managed Compatibility Mode" it shows me below error when I run the program again: "The runtime has encountered a fatal error. The address of the error was at 0x722f5a90, on thread 0xeb8. 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." NOTE: I'm using [DllImport("swedll32.dll", EntryPoint = "_swe_julday@24")]. Not sure but swedll32.dll is unmanaged c/c++ dll. – Nimesh Vaghasiya Sep 07 '17 at 17:43
  • nowadays, with VS 2019, this error occurs when the condition on `catch(ex) when (condition)` evaluates to a `NullReferenceException`. When this happens, your app crashes; visual studio throws fatal execution engine error – JobaDiniz May 19 '20 at 12:00
8

I recently hit this error and spent about 10hrs diagnosing the issue only to find the latest version of Cylance was interfering.

Essentially, Cylance memory protection was blocking local debug of web based projects (ASP and WCF were in our scope). Hope this saves someone else some time troubleshooting.

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
TWells68
  • 81
  • 1
  • 1
1

I was able to solve this issue by removing the hidden .vs folder in the solution directory.

zc2
  • 478
  • 3
  • 7
0

This resolved my issue:

Tools -> options -> IntelliTrace -> General

and check "Events Only" option

AymDev
  • 6,626
  • 4
  • 29
  • 52
sunm
  • 1
  • 2