Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iisexpress crash triggered by the client web browser. The error is "the program iisexpress exe has exited with code 0xc0000005 access violation"

When developing a Web appication, a button on the web client started crashing the application.

The VS Debug seesion and the Client browser close together. VS 2019 debug output shows the following error (no other information is available on client or server):

The program '[23396] iisexpress.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'. This bypasses all try/catch which makes it difficult to debug.

like image 682
Guy Avatar asked Dec 21 '25 15:12

Guy


2 Answers

I got this error because of an infinite recursive call.
To pinpoint such a bug add breakpoints and log lines (or step into)!!!

In my case, by mistake, a get property returned itself under some conditions.

This crash of Visual Studio Debug session naturally closes the Web Browser (opened by VS) which adds to the confusion. It's as if the client side crashed.
Only if you keep another browser session connected to localhost://nnnnn you see that it is the server that crashes.

like image 181
Guy Avatar answered Dec 24 '25 05:12

Guy


I personally experienced this error message when I was making a call to a system method(Process.GetProcessById()) in a property getter(IsRunning). Entity Framwork Core was accessing the getter on retrieval of the object that the property is on, and the system call caused the error message.

public bool IsRunning
{   get
    {
        var exited = Process.GetProcessById(ProcessId).HasExited;
        return !exited;
    }
    set
   {
        IsRunning = value;
   }
}

This was in hindsight, not big-brain. I changed to code to this:

public bool IsRunning { get; set; }

Pretty simple. I opted to avoid relying on the getter for the logic I wanted.

like image 20
Jeremiah Gavin Avatar answered Dec 24 '25 03:12

Jeremiah Gavin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!