I managed to write and install a small Windows service using VB.NET this afternoon (VB.NET 2005). It took a little bit of experimentation to get it installed using InstallUtil but I got there in the end.
However, when I start the service from the command line (NET START ...), it returns zero. If I start it from the SCM it starts and then immediately stops. There is a helpful popup dialog with the SCM which suggests that some Windows services start and then stop because they have nothing to do. I'm a bit confused by this because I thought services spent most of their time sitting waiting for an event to trigger them.
The service I have written creates a timer which is supposed to fire every 60 seconds. But the service comes up, starts the timer, then closes down immediately.
Can anyone suggest how I am supposed to make this service stay up?
However, when I start the service from the command line (NET START ...), it returns zero. If I start it from the SCM it starts and then immediately stops. There is a helpful popup dialog with the SCM which suggests that some Windows services start and then stop because they have nothing to do. I'm a bit confused by this because I thought services spent most of their time sitting waiting for an event to trigger them.
The service I have written creates a timer which is supposed to fire every 60 seconds. But the service comes up, starts the timer, then closes down immediately.
Can anyone suggest how I am supposed to make this service stay up?