Re: .Net (C#) Service Fails To Start
- From: Ken Allen <kendrhyd@xxxxxxxxxxxx>
- Date: Thu, 26 May 2005 08:25:23 -0400
OK, I have been over this so many times that I am getting dizzy. I have modified the configuration to add dependencies, but this makes no difference at all.
I am becoming convinced that the services that are failing (which are all .Net code) are doing so before they even attempt to execute. The only 'evidence' that I have of this is that when I added code to the programs to create Event Log entries in the Main() routine, when the service fails to start, not even these are present. This would indicate to me that there is a problem with launching the executable to begin with, even though the service is loading properly at installation time.
By the way, these services are being loaded as part of a larger installation, which requires a reboot. The services are not started immediately after installation, and the errors are first reported after the first reboot after the installation. The number of reboots that are performed before the services start properly vary, and there does not seemm to be any pattern. Not all system exhibit this problem, as some systems reboot and the services start fine the first time.
I am running out of things to try here. Anyone have any further suggestions?
-ken
Ken Allen wrote:
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: Willy Denoyette [MVP]
- Re: .Net (C#) Service Fails To Start
- References:
- .Net (C#) Service Fails To Start
- From: Ken Allen
- .Net (C#) Service Fails To Start
- Prev by Date: Re: enum Problem
- Next by Date: Re: Array.Sort not sorting by character code value?
- Previous by thread: Re: .Net (C#) Service Fails To Start
- Next by thread: Re: .Net (C#) Service Fails To Start
- Index(es):
Relevant Pages
|