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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With