Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unhandled exception logging facility for non-ASP.NET apps? (ELMAH for console apps)

Is there a facility similar to ELMAH but for non-ASP applications? One that will handle all unhandled exceptions and write them to multiple sources?

Or is there some way to easily capture all unhandled exceptions, similar to Application_Error in an ASP.NET Global.asax.cs file? If that can be done, I can then just use NLog or similar to log them. Was just hopeful a framework similar to ELMAH existed.

like image 939
Lemonbased Avatar asked Jan 23 '26 17:01

Lemonbased


1 Answers

You CAN capture unhandled exceptions in a WinForms app. This previous post contains the answer you are looking for.

Global Exception Handling for winforms control

Edit - added

Actually, here is a nicer article outlining how to do this.

http://msmvps.com/blogs/deborahk/archive/2009/09/02/global-exception-handler-winforms.aspx

like image 99
David Avatar answered Jan 26 '26 07:01

David



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!