The service manager expects a service to respond to the start request in
a relatively short period of time. I think it might be somewhere around
15-30 seconds.  If you do a lot of stuff in your OnStart function you
may be taking longer than that.

If you have a lot of code to run on service startup, you can run spawn
another thread to run that code, or use an asynchronous call.  There may
be a way to notify the service manager before OnStart returns, I haven't
tried that path.

> -----Original Message-----
> From: Alex Henderson [mailto:[EMAIL PROTECTED]]
> Posted At: Monday, May 06, 2002 10:27 PM
> Posted To: DOTNET
> Conversation: [DOTNET] C# Windows Service - Cant Start?
> Subject: [DOTNET] C# Windows Service - Cant Start?
> 
> I've got a windows service that I've built fairly stock-standard, it
also
> has its own installer, and I've built a separate install project...
> 
> The installer works well enough, and the service appears in the list
of
> services - however when you issue a start it eventually dumps with a
> message
> stating that the server did not respond in a timely fashion. If I then
> look
> in the list of processes, my service is there, I can attach to it in
the
> VS.Net debugger and I can see that it's working away (it's a server
with a
> number of worker threads it spawns for doing the actual work...).
> 
> Now at first I figured perhaps the code is never returning from the
> OnStart(...) method - so I commented out all start/stop etc. code in
the
> service class, basically leaving it at the same state as it was when
the
> project was created - however I still have the same problem of the
service
> start request timing out.... What could be causing this and can anyone
> suggest how I could fix it?
> 
> Cheers,
> 
> - Alex
> 
> You can read messages from the DOTNET archive, unsubscribe from
DOTNET, or
> subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to