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

Please help!

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

I receive this error when trying to start a simple Windows Service i've made in .NET 1.1. This happens only at my first attempt to start the service. The second attempt succeeds. Pausing and resuming have no problems. After I stop it i recieve the same Error 1053 at the first attempt.

DETAILS:

The event handles for the Stop and Start Events are empty:

protected override void OnStart(string[] args)
{
}

protected override void OnStop()
{
}

I also put a line to write to the applicatin log (AutoLog property being True as well) in the constructor.

public Service1()
{
// This call is required by the Windows.Forms Component Designer.
InitializeComponent();

// TODO: Add any initialization after the InitComponent call
EventLog.WriteEntry("Service1 constructor...");
}


Please help! I want to put this service on a machine to start automatically it the machine reboots and i don't want to use the recovery action to restart the service if it fails.

Thanks!


Answer this question

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

  • WNeidigh

    Try this--------------------------------------------------------------

    this is a bug with .Net Framework. plz clear all the events in application Log in your event viewers and then try starting the service. it has worked for me. the services would timeout if the logs are full.

    Thanks


  • Szász Bence

    Gabi, I already experienced the same error using performance counters in a windows service developed with c#.

    Did you set the MachineName property to "." string

    I resolved the problem using System.Environment.MachineName wich return the netbios name of the computer instead of using "."

    I don't know why PerformanceCounter cannot be initialized with this value at the service start event..... But using the hostname instead works.


  • SquareDanceSteve

    Cause

    This issue is Microsoft-related. The ServiceBase class calls the OnStop method directly from the Service command handler defined in the ScDispatcherLoop of the Advapi32.dll file. After 30 seconds, if the ScDispatcherLoop thread is not ready to receive a new service command from the Service Control Manager, the Windows Service Controller marks the service as time out. Therefore, you receive the error message.

    Resolution

    To resolve this problem, obtain the latest service pack for the Microsoft .NET Framework 1.1.



  • AsgerM

    I also used performance counter fr my service. This must have caused the problem. My best guess regarding the prblem would be that at the first attempt the perf counter category needed was not created. The first attempt might have created it as well. Therefore the second attempt was successful. Stopping the service deletes the perf counter i think and the whole story repeats.

    I have performed no actions regarding the performance counters. I just added it and also in installer for it.

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