Guy
Guy

Reputation: 1512

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.

Upvotes: 15

Views: 16142

Answers (3)

Emre Bener
Emre Bener

Reputation: 1462

I solved it by updating all of my packages with update-package in package manager console... it was a project that was upgraded to .net7 from .net core 3.1

seems to be happening doe to some service/library. if this doesnt help, try stripping away services one by one to find out which one is causing it. most likely has something to do with DI.

Upvotes: 0

Jeremiah Gavin
Jeremiah Gavin

Reputation: 41

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.

Upvotes: 3

Guy
Guy

Reputation: 1512

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.

Upvotes: 35

Related Questions