5

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?

Jader Dias
  • 84,588
  • 150
  • 415
  • 615

1 Answers1

3

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.

Community
  • 1
  • 1
Chris Dickson
  • 11,654
  • 1
  • 38
  • 57