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

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
 
T

TT \(Tom Tempelaere\)

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,
 
B

Burak Kadirbeyoglu

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
 
T

TT \(Tom Tempelaere\)

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,
 
B

Brian Pelton

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top