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. General Programming
  3. Visual Basic
  4. Write service to fail or crash.

Write service to fail or crash.

Scheduled Pinned Locked Moved Visual Basic
questiontestingdebuggingbeta-testing
4 Posts 2 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.
  • J Offline
    J Offline
    japel
    wrote on last edited by
    #1

    Hi All I am writing am app that I can call from the windows services recovery tab that emails me when the service fails. At present I have a written a service that has a counter that has a 10 second delay that throws an exception. But on testing the service it counts 10 ten sec's and crashes but never launches the test app from the service recovery tab (Notepad). Is the unhandled exception the same as a service failing? How do I write an app that crashes for testing? IDEAS.... P.S. What is even more annoying is that if I was writing a service it would have heaps of errors to debug and now the apposite :mad: Thanks

    When people make you see red, be thankful your not colour blind.

    J 1 Reply Last reply
    0
    • J japel

      Hi All I am writing am app that I can call from the windows services recovery tab that emails me when the service fails. At present I have a written a service that has a counter that has a 10 second delay that throws an exception. But on testing the service it counts 10 ten sec's and crashes but never launches the test app from the service recovery tab (Notepad). Is the unhandled exception the same as a service failing? How do I write an app that crashes for testing? IDEAS.... P.S. What is even more annoying is that if I was writing a service it would have heaps of errors to debug and now the apposite :mad: Thanks

      When people make you see red, be thankful your not colour blind.

      J Offline
      J Offline
      Jason McBurney
      wrote on last edited by
      #2

      Take a look at dainel's article on exceptions: Exception Best Practices[^] It has a lot of good informaiton regarding general exception handling. Also a service should deal with the errors raised from within. In the case where an error is unhandled the domain error handler will attempt to catch it. You may wish to install a error handler in the System.AppDomain.CurrentDomain.UnhandledException Event. This can of course call your:

      japel wrote:

      test app from the service recovery tab (Notepad).

      You can only be young once. But you can always be immature. - Dave Barry

      J 1 Reply Last reply
      0
      • J Jason McBurney

        Take a look at dainel's article on exceptions: Exception Best Practices[^] It has a lot of good informaiton regarding general exception handling. Also a service should deal with the errors raised from within. In the case where an error is unhandled the domain error handler will attempt to catch it. You may wish to install a error handler in the System.AppDomain.CurrentDomain.UnhandledException Event. This can of course call your:

        japel wrote:

        test app from the service recovery tab (Notepad).

        You can only be young once. But you can always be immature. - Dave Barry

        J Offline
        J Offline
        japel
        wrote on last edited by
        #3

        The article was interesting from a error handling point of view. I was looking for the opposite, I need a service to fail the triggers the service recovery option and let's me run a program. Thanks

        When people make you see red, be thankful your not colour blind.

        J 1 Reply Last reply
        0
        • J japel

          The article was interesting from a error handling point of view. I was looking for the opposite, I need a service to fail the triggers the service recovery option and let's me run a program. Thanks

          When people make you see red, be thankful your not colour blind.

          J Offline
          J Offline
          Jason McBurney
          wrote on last edited by
          #4

          Will your requirements allow you to start recovery process from within the service? Or does it have to be in a differnt app domain? ~Jason

          You can only be young once. But you can always be immature. - Dave Barry

          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