Problem getting UnhandledExceptionEventHandler to work in service application

M

Manfred Braun

Hi All,

in a windows service application [System.ServiceProcess.ServiceBase], I add
an eventhandler to the Application Domain:

public static void Main()
{
System.ServiceProcess.ServiceBase.Run(new SimpleServiceDemo1());;
AppDomain.CurrentDomain.UnhandledException +=
new
UnhandledExceptionEventHandler(SimpleServiceDemo1ExceptionEventHandler);
}

But my exceptionhandler is never called. What do I possibly wrong here?????

My eventhandler is simple:

public static void SimpleServiceDemo1ExceptionEventHandler
(object sender, UnhandledExceptionEventArgs e)
{
DebugOutput.OutputDebugString("Hallo!");
.......

(My "DebugOutput.OutputDebugString" works well in all other function of my
service).
Any help, hints or pointer to further information would really be very
welcomed!!

Best regards,
Manfred Braun

(Private)
Mannheim
Germany

mailto:[email protected]
(Remove the anti-spam-underscore to mail me!)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top