By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,720 Members | 2,145 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,720 IT Pros & Developers. It's quick & easy.

How to define a global exception handler in a windows service?

P: n/a
I am having some difficulties implementing an UnHandledException
handler for the AppDomain.UnhandledException event in a windows
service for unhandled exceptions that occur on a System.Timers.Timer
elapsed event thread. I have just a few questions concerning the
AppDomain.UnhandledException event.

I have been to get my unhandledException handler to work correctly
when I generate an exception on the main service thread. However, my
global exception handler is not working when I generate an exception
in a thread that is created via the Timer elapsed event.

Going forward, I am going to implement a try/catch block in the timer
elapsed event but I am just curious to find out if there is a way to
implement a global exception handler in a windows service that
utilizes the system.timers.timer component.
1. Could someone explain to me how exceptions that occur on a
System.Timers.Timer thread are handled in relation to the main thread?

2. Is is possible to implement a global exception handler in a windows
service? Any suggestions?
Any information that can be provided will be greatly appreciated!

- Derek
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.