Diagnosing CLR errors in Windows Event Viewer
Asked Answered
H

1

6

We have an .NET desktop application that crashed in production. How do we diagnose the error? I'd like to know the type of exception that occurred, the error message, and the stack trace.

Because the exception wasn't handled by our code, we received the "This application has encountered a problem and needs to close" Windows message box. The only option was to close, there was no debug button.

This MSDN article suggested looking in the Windows Event registry. I checked there, and here's the information inside it:

Faulting application Initect.Server.UI.exe, version 0.12.9084.90, time stamp 0x49cac472, faulting module KERNEL32.dll, version 6.0.6001.18000, time stamp 0x4791a81d, exception code 0xe0434f4d, fault offset 0x0002f35f, process id 0x44c, application start time 0x01c9ada7f320cab0

How can this information tell me the exception type, the stack trace, and the error message?

Hyacinthie answered 2/4, 2009 at 18:32 Comment(0)
M
3

That information isn't enough to get you a stack trace, exception type, error message, etc.

You can configure Windows Error Reporting (which showed you the problem & needs to close UI) on Windows Server 2008 to always collect a dump file that you can then debug. This doesn't require you to install Visual Studio or any other debugger in your production environment.

http://blogs.technet.com/askperf/archive/2008/02/05/ws2008-windows-error-reporting.aspx shows the proper registry settings to do this.

Meso answered 2/4, 2009 at 18:36 Comment(5)
That link you sent shows me how to generate mini dumps. What do I do with mini dumps?Hyacinthie
You can open them up in Visual Studio for post-mortem debugging. They show the state of your process at the time of the crash.Meso
msdn.microsoft.com/en-us/library/d5zhxt22.aspx looks to be a good starting point.Meso
Thanks. I must say in passing, this seems far more difficult than it should be. Seems the CLR should put the error information into the log automatically when it encounters an unhandled managed exception.Hyacinthie
link is broken. Do you have a new one?Ronaldronalda

© 2022 - 2024 — McMap. All rights reserved.