.Net (C#) Service Fails To Start
- From: Ken Allen <kendrhyd@xxxxxxxxxxxx>
- Date: Wed, 11 May 2005 10:04:05 -0400
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 .
- Follow-Ups:
- Re: .Net (C#) Service Fails To Start
- From: Ken Allen
- Re: .Net (C#) Service Fails To Start
- From: Jason
- Re: .Net (C#) Service Fails To Start
- From: Alan Pretre
- Re: .Net (C#) Service Fails To Start
- From: Jared Parsons [MSFT]
- Re: .Net (C#) Service Fails To Start
- Prev by Date: Scope of internal method in C#?
- Next by Date: implementing dragdrop whilst allowing click
- Previous by thread: Scope of internal method in C#?
- Next by thread: Re: .Net (C#) Service Fails To Start
- Index(es):
Relevant Pages
|
Loading