开发者

How to capture unhandled exceptions on Windows Services? [duplicate]

This question already has answers here: How can I set up .NET UnhandledException handling in a Windows service? (5 answers) 开发者_运维知识库 Closed 7 years ago.

I use AppDomain.UnhandledException Event to capture unhandled exceptions on WPF, Console and WinForms apps.

But the same code isn't working on Windows Services. What should I do?


See my answer added to the linked SO question.

There are a number of places in your service code where a thrown exception will not be "unhandled" even if you don't handle it, because the base class does so before it reaches the AppDomain's default handler.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜