Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Checking the fail status of windows service

Checking the fail status of windows service

Scheduled Pinned Locked Moved ASP.NET
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gottimukkala
    wrote on last edited by
    #1

    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!

    A N Y 3 Replies Last reply
    0
    • G gottimukkala

      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!

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • G gottimukkala

        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!

        N Offline
        N Offline
        N a v a n e e t h
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • G gottimukkala

          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!

          Y Offline
          Y Offline
          Yusuf
          wrote on last edited by
          #4

          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[^]

          G 1 Reply Last reply
          0
          • Y Yusuf

            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[^]

            G Offline
            G Offline
            gottimukkala
            wrote on last edited by
            #5

            Thanks all for your replies. Sorry, I will post next time in other forum.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups