views:

372

answers:

1

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?

+1  A: 

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.

Michael
That link you sent shows me how to generate mini dumps. What do I do with mini dumps?
Judah Himango
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.
Michael
http://msdn.microsoft.com/en-us/library/d5zhxt22.aspx looks to be a good starting point.
Michael
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.
Judah Himango