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

    Question

  •  

    Hi All,

     

    I created a basic windows service in C#.

    When i start it from AdministrativeTools/Services, this message pops up:

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

    I have .NET 3.0 on my machine with XP professional.

     

    I have read lot of info regarding this error,there are so many results for this error when searched but no appropriate fix.All they say if there is lot of logic inside OnStart(), which may consume more than 30 seconds, then you may get time out error. But that is not the case. The logic in my OnStart() should hardly take 1 second.

    In the function OnStart(), i go into a small loop to print 10 numbers to log.

     

    I have even tried spawning a thread and executing my logic in it. Then also the same error pops up.

    The progress bar showing: service starting is hardly for a second and then the time out error pops up.

     

    I am running the service under a particular user account, which is administrator on that machine.

     

    Responses are really appreciated.

     

    regards,
    Santosh Jami.

     

    Wednesday, February 20, 2008 7:17 PM

Answers

  •  

    did you check your event log from EventVwr?

     

    service actions are always loggin system event.

     

    you can check or find that reason of starting service failure.

     

    in my guess, log part is may have some problem. logging to where? if to file, then is file created successfully?

    Thursday, February 21, 2008 5:20 PM

All replies

  •  

    did you check your event log from EventVwr?

     

    service actions are always loggin system event.

     

    you can check or find that reason of starting service failure.

     

    in my guess, log part is may have some problem. logging to where? if to file, then is file created successfully?

    Thursday, February 21, 2008 5:20 PM
  • Hi!

    I got the same error when I tried to use the window service to launch a Server application. Is there anyway to get arround this error? My case is little bit different. Even thought the error displayed, my server process was actually running. However, its status showed as "Starting..." and I cannot stop, pause or restart my window service.

    I appreciate if you can give me an advice how to resolve this problem. Installing Framework 1.1 SP1 does not fix the problem as told on the MS Support page.

    Thanks,

    Locx
    Friday, June 27, 2008 4:32 AM
  • This is the exact same error I get. 1053, but the process starts successfully and continues to run, but with no way of stopping it I have to shut it down from task manager.
    What gives?
    Monday, June 30, 2008 4:06 PM
  • I know what it is now. In my startup code I had a while thread is alive loop in a listening service. So the startup method was never exiting. I fixed this by spawning a new thread to start the application while exiting the Main() method to return to the service start call.
    Check that you don't have any loops or long delays in starting your application.
    That explains why the service start failed but the task manager showed the application running successfully.
    • Proposed as answer by reckface Friday, July 04, 2008 9:28 AM
    Friday, July 04, 2008 9:28 AM
  • I'm receiving the same error. The code below is running on two other servers but the sysadmin folks are telling me its a code issue. When starting it takes about 2 seconds to error. I added the logging to see if I could catch an error but it doesn't appear to reach it. Any thoughts?? Thanks!

     

     

    static

     

    void Main()

    {

     

    ServiceBase[] ServicesToRun;

    ServicesToRun =

    new ServiceBase[]

    {

     

    new NOTAMReceiver()

    };

     

    try

    {

     

    ServiceBase.Run(ServicesToRun);

     

    MessageLogger.WriteLog("Thread Started Successfully ...", LoggingType.Debug);

    }

     

    catch (Exception ex)

    {

     

    MessageLogger.WriteLog("Error starting Thread: " + ex.Message, LoggingType.Error);

    }

     

    }

    Tuesday, July 20, 2010 3:59 PM
  • HI All

     

    Some time due to the CPU 100 % usage it wont start.

    pls checkCPU usage

    Friday, July 29, 2011 11:14 AM