Hi all,
We have an n-tier application structure build with the help of WCF. Our Hosting Service is an Windows Service for production and a Console application witch starts all the services for development.
The problem is that when an UNHADLED Exception rases the Hosting Service stops and someone have to turn it on again.
I want when an unhandled exception rases:
1. to handle it and to show an appropriate message on the presenter side
2. not to stop my service or at least to restart it.
What I've tried till now:
1.
host.Faulted += ServiceHost_Faulted; If a service faults that's enough too handle the exception
2. AppDomain currentDomain = AppDomain.CurrentDomain;
currentDomain.UnhandledException +=
new UnhandledExceptionEventHandler(GlobalExceptionHandler);
in the Main method ot OnStart() if service
The problem is that there could be exceptions in the Data Access Layer or Business Logic which are not in a try catch block and are not handled by those two methods I mentioned above.
My Question is: Is there a global way to handle all unhandled exception in every tier of the application?