.Net (C#) Service Fails To Start



I have a number of services developed in C# (.Net), and they have been working fine for the most part. Recently someone reported that ipon occassion (originally rarely, but more frequently on some systems of late), there is an entry in the Event Log immediately after a boot indicating that the service failed to start after 30,000 milliseconds. Usually it starts fine when attempting manually after the boot.

I instrumented the code to write entries to the Event Log during its main() execution as well as during the OnStart() execution -- but when it fails, there are no entries in the Event Log from the service code!

Attempting to launch the service as a console application always seems to succeed. Interestingly, launching as a console application is about 10 times faster than starting the service! In no case that the service loaded properly did the time pass the 500 milliseond duration!

I checked and there are no dependencies marked for the service. Is it possible that .Net is not available at that time and the service cannot execute?

How can I define any dependencies at compile time? The ServiceInstaller permits me to define a list of services to depend on, but there does not seem to be any dependency on other objects. Nor does there appear to be any .Net service on which I could wait.

Does anyone have any ideas on why my service may be failing to load, but only at boot time?

Where does the /LogToConsole=false switch setting come from on my installed services? How do I change this to true, and what effect would that have on my service?

-ken
.



Relevant Pages

  • Re: .Net (C#) Service Fails To Start
    ... enough that they will not always work when invoked during the boot process! ... I instrumented the code to write entries to the Event Log during its ... mainexecution as well as during the OnStartexecution -- but when ... I checked and there are no dependencies marked for the service. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: .Net (C#) Service Fails To Start
    ... In your OnStart function, put a line at the beginning like "Thread.Sleep" and put a breakpoint at the following line. ... Recently someone reported that ipon occassion, there is an entry in the Event Log immediately after a boot indicating that the service failed to start after 30,000 milliseconds. ... I instrumented the code to write entries to the Event Log during its mainexecution as well as during the OnStartexecution -- but when it fails, there are no entries in the Event Log from the service code! ... I checked and there are no dependencies marked for the service. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Maven using ANT plugin for SCP task : Embedded error: Could not create task or type of type: scp
    ... My requirement is automating the build process which contains execution ... I am getting pear help in ANT, ... Similarly I plan to use ANT task scp via ANTRUN plugin for Maven. ... I have downloaded the jar "jsch-0.1.24.jar" via dependencies. ...
    (comp.lang.java.programmer)
  • Re: strange slow boot
    ... ran the event log like you suggested. ... continued to load 11 additional services normally within about 35 seconds. ... > slow boot can be caused by Service Startup Time-outs. ...
    (microsoft.public.windowsxp.general)
  • Re: SBS 2003 - Servicss not starting
    ... My only thought is to look at all the dependencies of the stopped services ... to see if you can figure out the first domino in the chain. ... to get event log running for the obvious reason. ... I then discovered that while the network card was in Device Manager, ...
    (microsoft.public.windows.server.sbs)

Loading