I have an ASP.NET Web API application that crashes randomly without giving me an error message. I have not been able to reproduce it reliably - it does not happen when calling a particular endpoint or doing a particular action. Sometimes it works flawlessly for hours, and then it crashes when the exact same action is performed, that worked multiple times without a hitch.
I get no error message. When running in debug mode in VS, the debugger just exits. No unhandled exception popups, and no relevant info in the output window from what I've seen. This happens both when debugging using IIS Express and regular IIS (although with regular IIS it seems to happen a bit less often)
When running in production, IIS just restarts the app. The windows event log sometimes shows this error message:
Faulting application name: w3wp.exe, version: 10.0.14393.0, time stamp: 0x57899b8a
Faulting module name: KERNELBASE.dll, version: 10.0.14393.321, time stamp: 0x57f4c4f0
Exception code: 0xe0434352
Fault offset: 0x0000000000017788
Faulting process id: 0xb0c
Faulting application start time: 0x01d3a4b352f9d1a1
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: 03e2f1a6-18a5-493b-8c41-74e59941eac7
Faulting package full name:
Faulting package-relative application ID:
Sometimes this error message:
Application: w3wp.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at System.Web.Hosting.UnsafeIISMethods.MgdExplicitFlush(IntPtr, Boolean, Boolean ByRef)
at System.Web.Hosting.IIS7WorkerRequest.ExplicitFlush()
at System.Web.HttpResponse.Flush(Boolean, Boolean)
at System.Web.HttpWriter.WriteFromStream(Byte[], Int32, Int32)
at System.IO.Stream+<>c.<BeginWriteInternal>b__46_0(System.Object)
at System.Threading.Tasks.Task`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].InnerInvoke()
at System.Threading.Tasks.Task.Execute()
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)
at System.Threading.Tasks.Task.ExecuteEntry(Boolean)
at System.Threading.ThreadPoolWorkQueue.Dispatch()
I've tried adding logging to Application_Error and Exception handlers in the startup class, but nothing seems to catch anything.
Does anyone recognize these problems? What can I do to try to get a more detailed error message?
User contributions licensed under CC BY-SA 3.0