A
Adam J. Schaff
For apps I have written in the past, I have always been able to define a
global event handler. Something along the lines of this:
AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf
MyErrHandlerProc
However, I now have a windows service application and when errors occur in
it, I do not receive them. I cannot figure out how to tap into unhandled
exceptions in a windows service. I tried putting the above line of code into
both the Sub Main and the OnStart, and followed it with a "Throw New
Exception" just to see if it would get caught, and it did not. Obviously,
I'm new to windows service and multi-threaded programming.
Can anyone help me out with exception handling? I'd really hate to have to
wrap every procedure of my code with try..catch. It's ugly and I'm not sure
how it would affect performance.
Any help would be deeply appreciated. Thanks.
global event handler. Something along the lines of this:
AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf
MyErrHandlerProc
However, I now have a windows service application and when errors occur in
it, I do not receive them. I cannot figure out how to tap into unhandled
exceptions in a windows service. I tried putting the above line of code into
both the Sub Main and the OnStart, and followed it with a "Throw New
Exception" just to see if it would get caught, and it did not. Obviously,
I'm new to windows service and multi-threaded programming.
Can anyone help me out with exception handling? I'd really hate to have to
wrap every procedure of my code with try..catch. It's ugly and I'm not sure
how it would affect performance.
Any help would be deeply appreciated. Thanks.