Q:

Unhandled Exception in Windows Service

I am using system.timer in a windows service application (c#) and have added:
AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException += 
       new UnhandledExceptionEventHandler(MyExceptionHandler);

To handle my exceptions, does this work in a Windows Service as it does not seem to work?
Does anyone have any alternative ideas?

A:

This mechanism will work to capture Unhandled Exceptions in any environment including Windows Services.  However there are some limitations on what kind of exceptions can be handled in this way.  For instance, a StackOverFlowException may be unhandled but do to it's nature you won't ever see it go through an UnhandledException handler.  
Why do you think this is not working?  Have you tried attaching to the process with a debugger , enabling first chance exceptions and see what is going on?  

