Automatic startup of service

J

Jeremy Chapman

I built a service in visual studio 2003 for the 1.1 framework. I used the
wizard. For the most part this service works great, and has for several
months, except for when the service restarts. on a 2003 server the service
starts up fine. on a 2000 server I get an event log errors: There's
nothing really that this service does that takes longer than 30 seconds. I
can manually start this service no problem, but I need it to start when the
server starts.

The MyService service failed to start due to the following error:
The service did not respond to the start or control request in a timely
fashion.

Timeout (30000 milliseconds) waiting for the MyService service to connect.
 
J

John Saunders

Jeremy Chapman said:
I built a service in visual studio 2003 for the 1.1 framework. I used the
wizard. For the most part this service works great, and has for several
months, except for when the service restarts. on a 2003 server the
service
starts up fine. on a 2000 server I get an event log errors: There's
nothing really that this service does that takes longer than 30 seconds.
I
can manually start this service no problem, but I need it to start when
the
server starts.

The MyService service failed to start due to the following error:
The service did not respond to the start or control request in a timely
fashion.

Timeout (30000 milliseconds) waiting for the MyService service to
connect.

Try doing as little as possible in your start method and see if the problem
goes away. In particular, as a debug technique, try removing all of the code
from the start method and see if the problem persists on W2K.

John Saunders
 
T

Trevor Braun

Your service doesn't depend on another service like MSSQL or something? If
so, make sure you add the required service(s) to the ServicesDependedUpon
string array in the ServiceInstaller.

Trevor Braun
 
J

Jeremy Chapman

Brilliant!

Turns out I had to add Eventlog and RemoteRegistry to the
ServicesDependedUpon property. Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top