Managed Debugging Assistant 'FatalExecutionEngineError' Error in IIS Express - c#

I have NET Framework 4.7.2 Web Application which was running fine till last week.
Recently I have updated Windows OS. Details:
Edition: Windows 10 Enterprise
Version: 21H2
OS build: 19044.1348
Experience: Windows Feature Experience Pack 120.2212.3920.0
After upgrading the OS, I started to have following issue while launching the WebApplication on IIS Express.
Managed Debugging Assistant 'FatalExecutionEngineError' has detected a
problem in C:\Program Files\IIS Express\iisexpress.exe.
Additional Information: The runtime has encountered a fatal error. The
address of the error was at 0xc488d19a, on thread 0x57d4. 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 don't know how to fix this issue.
If I host the application on IIS it works fine.

Related

Exception of type 'System.ExecutionEngineException' was thrown

I'm having an issue that when i run my application on Service Fabric,
i get this exception, and also "FatalExecutionEngineError' : 'The runtime has encountered a fatal error. The address of the error was at 0x1e477a47, on thread 0x5b24. The error code is 0x80131623. 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".
When I go to the event viewer this is what I get as an exception when the application crashes:
enter image description here
and also on service fabric:
enter image description here
I tried to reinstall visual studio, service fabric, reinstalled windows, I tried the installation of the app on other computer, it appeared the same thing.
Somone that could give me paths how to fix this out?
I'm running my application on:
VS 2019 community,
.NET framework 4.6.1,
5.0.407 SDK,
Service fabric 9.1,
Sf SDK 5,
Windows 11
Regards,

VS 2017 unable to attach to w3wp

I'm trying to debug a .NET site (local IIS) hosting the DLL I'm developing using VS 2017 Community Edition (on a Windows 7 Enterprise workstation).
When I try to attach to w3wp.exe linked to the application pool, I get an error saying :
Unable to attach to the process. An unknown error occurred in the Windows Web Service infrastructure (translation from french message).
The connection type is set to Default
The connection target is the local computer
I can see the w3wp.exe process in the list provided by VS and it is of type x64 (no mention of managed code).
Is there an option I'm missing to be able to debug a 64 bits .NET app ?
Any tips welcome
Thanks in advance

Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime

I am trying to run my console application on linux machine using mono , application was running but it stop by showing error on console
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application
please help me to come out from this problem ?
Try upgrading your mono version. Also see if using --arch=32 flag will work, if it is a 32bit binary.

.NET Runtime Error Event Id 1026

I have a WPF application I have created on a Windows 8.1 machine targeting .NET runtime 4.5.1. It runs fine on the development machine.
I am trying to install it on a Windows 7 machine. It has .Net 4.5.1 installed. When I try to run it on the Windows 7 Machine the login window comes up. When I enter the password, the application verifies the password then it crashes. I have verified that it is connecting to the server to verify the password...so it's not a SQL Connection error.
So it appears that it happens when the main application windows is trying to display. Here is the info that gets recorded in the Application log. Notice the framework version. The app is targeting 4.5.1. So I don't understand why it is showing 4.0.30319.
Application: HardwarResources.WPF.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Data.Core.EntityCommandExecutionException
Stack:
at System.Windows.Window.ShowDialog()
at HardwareResources.WPF.MainEntry.Main(System.String[])
The only other pertinent information is Event ID: 1026.
HELP!
I had the same problem when I copied the .exe file (Debug or Release) to another machine and it would simply not work! Showed up in task manager for a few seconds and would disappear leaving only an ArgumentOutOfRangeException and a Kernelbase.dll error in the application event logs. So I decided to install Visual Studio on the machine where the file would not launch. After copying the project folder to a different file structure than on the original machine and hitting compiling it, I found out that I was trying to cut a string (file path) shorter than it was (due to different file structure). So the problem was in the code itself and NOT in any .dlls or .NET versions.
Hope I have helped!
Try adding an event handler to AppDomain.CurrentDomain.UnhandledException to trace more detail about the error. See here for reference on catching unhandled exceptions.
I'm thinking it's something to do with cross-threading, thread synchronization context (requiring invoke) or perhaps missing [STAThread] attribute on Main.
If you're trying to feed data to a dialog, you have to go about it in a thread-safe manner.

.NET Winforms app dies on startup

I have a .NET Winforms app written in C# which works everywhere but on one particular machine. On that machine it dies without ever starting. There is no error message, but the following is written to the event log:
Type: Error
Source: .NET Runtime 2.0 Error Reporting
Description: Faulting application myapp.exe, version 4.2.0.0, stamp 4bcf05d0, faulting module kernel32.dll, version 5.2.3790.4480, stamp 49c51f0a, debug? 0, fault address 0x0000bef7.
There doesn't seem to be anything odd about that machine - it is one of a number of clones created with VSphere, and doesn't exhibit any other issues. The other clones run my app without any problem. It is Windows Server 2003 SP2 with .NET Framework 3.5 SP1, running Citrix, which was reinstalled after the clone to take the new name (as were the other clones).
Any advice on how to diagnose or trap the issue?
Also, I am soon going to release a new version of my app, is there anything I can do to the new version to give more information on this kind of problem?
EDIT: Thank you all for your answers, unfortunately the sysadmins for the machine decided to just rebuild it from scratch, and the problem went away. So I'll probably never know what the problem was.
Install Debugging tools for Windows on that machine, and use WinDbg to launch your application. Then it should tell what exceptions happen.
If the error is related to environment (such as missing assembly) then the app will not reach a point where you can trap & log it.
I would create a new console application and then load such app into new AppDomain and run it with ExecuteAssembly. If the errors are .NET exceptions you will be able to catch them and write to a console window.
Is your MyApp.Exe.Config a correct XML file? Open it in Visual Studio, and see if there are any errors against the XML format.

Categories