3

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.

4

1 回答 1

1

您可以在 WinForms 应用程序中捕获未处理的异常。上一篇文章包含您正在寻找的答案。

winforms控制的全局异常处理

编辑 - 添加

实际上,这是一篇更好的文章,概述了如何做到这一点。

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

于 2009-10-20T21:48:58.170 回答