Error 1053: The service did not respond to the start or control request in a timely fashion

  • Thread starter Thread starter Burak
  • Start date Start date
B

Burak

Dear .NET Developers,

I encountered the following error message when tyring to start a custom
developed service: Error 1053: The service did not respond to the start or
control request in a timely fashion. I managed to install the service with
installutil.exe, but I cannot get it started. Microsoft's KB suggests to
install .NET Framework 1.1 SP1, but I already have it. This problem occurs
only on the production machine, the service runs on the development server.
Do you have any suggestions? Thanks in advance,

Burak Kadirbeyoglu
 
Hi Burak,

Burak said:
Dear .NET Developers,

I encountered the following error message when tyring to start a custom
developed service: Error 1053: The service did not respond to the start or
control request in a timely fashion. I managed to install the service with
installutil.exe, but I cannot get it started. Microsoft's KB suggests to
install .NET Framework 1.1 SP1, but I already have it. This problem occurs
only on the production machine, the service runs on the development
server. Do you have any suggestions? Thanks in advance,

Burak Kadirbeyoglu

Did you start a new thread from the OnStart method?

Could you post the code?

Kind regards,
 
Hi Tom,

You can find the code below:

static void Main()
{
System.ServiceProcess.ServiceBase[] ServicesToRun;

ServicesToRun = new System.ServiceProcess.ServiceBase[] { new
EmailService() };

System.ServiceProcess.ServiceBase.Run(ServicesToRun);
}


protected override void OnStart(string[] args)
{
tmrWake.Interval =
Convert.ToDouble(ConfigurationSettings.AppSettings["Timer.Interval"]);
tmrWake.Enabled = true;
}

Thanks,

Burak
 
Burak,

Burak Kadirbeyoglu said:
Hi Tom,

You can find the code below:

static void Main()
{
System.ServiceProcess.ServiceBase[] ServicesToRun;

ServicesToRun = new System.ServiceProcess.ServiceBase[] { new
EmailService() };

System.ServiceProcess.ServiceBase.Run(ServicesToRun);
}


protected override void OnStart(string[] args)
{
tmrWake.Interval =
Convert.ToDouble(ConfigurationSettings.AppSettings["Timer.Interval"]);
tmrWake.Enabled = true;
}

Thanks,
Burak

I have never made a service that has only a timer. IIRC, the OnStart handler
should at least start a new thread to perform work (but I could be wrong
here). Also, I don't see you binding any handler for the timer.

Anyway, a suggestion. Try to start a thread from the OnStart, and stop the
thread in OnStop. This thread can just do a Thread.Sleep( Infinite ), it is
just to check if the same error persists.

Kind regards,
 
My experience has been services that fail to start are throwing
exceptions. It could be due to a number of reasons.
 
Back
Top