I am using windows service in c# for file transfer using sFTP (ssh.net).
I have handled exception in each and every block of code still i am getting unhandled exception and my my windows service gets crashed.
i figured out about unhandled exception by using
AppDomain.CurrentDomain.UnhandledException
Is is possible to avoid this unhandled exception and avoid service from being crashed.
Thanks in advance.
Vijay
No, because
UnhandledExceptiondoes not change the fact that the process is going down. It just gives you the chance to do something (e.g. log the failure) before that happens.Even if things could work like that, the fact is that your service has bugs. You should be looking more to fix them and less to hide them.