Re: C# service, performs lots of things on start, windows doesnt give it enough time!



Hi Craig,

you've got many other responses already, but I suggest that you take a look
at the ServiceBase class' method RequestAdditionalTime.

This method is:

"...intended to be called by the overridden OnContinue, OnPause, OnStart, or
OnStop methods to request additional time for a pending operation, to
prevent the Service Control Manager (SCM) from marking the service as not
responding. If the pending operation is not a continue, pause, start, or
stop, an InvalidOperationException is thrown".

This was from the MSDN documentation. This method might solve your issues,
if you call it in the OnStart event handler.

Hope this helps!

--
Regards,

Mr. Jani Järvinen
C# MVP
Helsinki, Finland
janij@xxxxxxxxxxxxxxxxxxxxxx
http://www.saunalahti.fi/janij/


.