We have a .Net 3.5 C# / Winforms desktop application with a very limited size/scope/userbase (40 users). I need a way to gather more information about unhandled exceptions, but I don't believe I need anything as big or broad as the Microsoft Exception Handling Application Block*. I just need capture and send.
Is there an exception handler similar in scope and feature set to Jeff Atwood's "User Friendly Exception Handling", for C# on a newer version of .Net? (in my case 3.5, but we eventually hope to move to 4+)
I would love to use ELMAH, but it doesn't work with Winforms.
Alternately, can Jeff Atwood's exception handling work with C# 3.5 / winforms?
*more precisely, I prefer Mr. Atwood's concise 2004 blog post describing his solution and its limited, but useful scope, over the broad and vague documentation of the other. We should all strive to explain components well enough that people are asking for them to be ported to another language 9 years later. ;-)
You could set up an unhandled exception handler, then log those exceptions out using a library like ELMAH but configurable from code, given you don't have a web.config.
We use: http://nuget.org/packages/StackExchange.Exceptional/
Catching unhandled exceptions: http://mike.woelmer.com/2009/04/dealing-with-unhandled-exceptions-in-winforms/
I've been using my own version of Jeff's code for years. It works fine under every target I've ever tried.
Is there a reason you don't think it will work?
Just change the target and rebuild.
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