Write service to fail or crash.
-
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.
-
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.
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
-
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
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.
-
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.
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