Description: Stopped working Problem signature: Problem Event Name: CLR20r3 Problem Signature 01: appName.exe Problem Signature 02: 1.0.0.0 Problem Signature 03: 516eb9fb Problem Signature 04: mscorlib Problem Signature 05: 2.0.0.0 Problem Signature 06: 4a27471d Problem Signature 07: 20c8 Problem Signature 08: 100 Problem Signature 09: N3CTRYE2KN3C34SGL4ZQYRBFTE4M13NB OS Version: 6.1.7600.2.0.0.274.10 Locale ID: 2057
And the most annoying part is that if I try to debug it it won't fail...
Finally I found a blog post with answers Handling “Unhandled Exceptions” in .NET 2.0.
And I came up with this piece of code, that I placed in the Main method of my application:
AppDomain.CurrentDomain.UnhandledException += delegate(object sender, UnhandledExceptionEventArgs e) { EventLog.WriteEntry("appName", string.Format("{0} – IsTerminating = {1}", e.ExceptionObject.ToString(), e.IsTerminating), EventLogEntryType.Error, 001); };Then I ran my app again and it crashed, but this time I got a NICE exception in the event viewer.
Thanks Mark.
No comments:
Post a Comment