Checking the fail status of windows service
-
Hi How can we check the failure of windows service programatically. I have a windows service that elapses every 5 minutes and I need to check if the service is failed then restart it automatically in my code. I googled but I couldnt find the Failed Status for the windows service. Any ideas please!
-
Hi How can we check the failure of windows service programatically. I have a windows service that elapses every 5 minutes and I need to check if the service is failed then restart it automatically in my code. I googled but I couldnt find the Failed Status for the windows service. Any ideas please!
gottimukkala wrote:
. I have a windows service that elapses every 5 minutes and I need to check if the service is failed then restart it automatically in my code.
From where do you want to check it? BTW : How does it come to ASP.NET Forum ? :sigh:
cheers, Abhijit CodeProject MVP
-
Hi How can we check the failure of windows service programatically. I have a windows service that elapses every 5 minutes and I need to check if the service is failed then restart it automatically in my code. I googled but I couldnt find the Failed Status for the windows service. Any ideas please!
gottimukkala wrote:
I need to check if the service is failed then restart it automatically in my code
Wrap your main method in try/catch blocks. So you can handle *all* exceptions. BTW, this question has nothing to do with ASP.NET. Plese post in the correct forum next time.
Navaneeth How to use google | Ask smart questions
-
Hi How can we check the failure of windows service programatically. I have a windows service that elapses every 5 minutes and I need to check if the service is failed then restart it automatically in my code. I googled but I couldnt find the Failed Status for the windows service. Any ideas please!
Well, first you need to handle all possible failures in your application. Windows Services can perform some actions when it fails. Looks at Services windows in the recovery tab. One of the option is 'Restart the service' Before you go head and select this, mind the consequence of your action. If there is something in your app or data that is thrown an exception, and it repeats every time the service starts, you will end up chasing your tail. :-O BTW: Next time use the right forum.
Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
-
Well, first you need to handle all possible failures in your application. Windows Services can perform some actions when it fails. Looks at Services windows in the recovery tab. One of the option is 'Restart the service' Before you go head and select this, mind the consequence of your action. If there is something in your app or data that is thrown an exception, and it repeats every time the service starts, you will end up chasing your tail. :-O BTW: Next time use the right forum.
Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
Thanks all for your replies. Sorry, I will post next time in other forum.