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

    Question

  • Hi all,

     

    I developed a kind of code to create a Windows Service. The purpose of the service is to start a ".bat" file when the service is started and run another .bat when the service is stopped.

    1. Start MyService - runs startProject.bat

    2. Stop MyService - runs stopProject.bat

    The problem is that when I try to run the service, I received this error above. It doesn't take nor 1 second to shows this error. It's so strange because in the eventviewer log it shows:

    Timeout (30000 milliseconds) waiting for the MyService service to connect.

    The MyService service failed to start due to the following error:
    The service did not respond to the start or control request in a timely fashion.

     

    Any clues on this will be very appreciated. If you would like to take a look on my source code please put an email address and I will forward it to you.

     

    Many thanks,

    Helder

     

    Friday, October 08, 2010 12:41 PM

Answers

  • Hi,

     

    I would like to suggest you check if the following Microsoft KB articles are helpful:

     

    FIX: You receive an "Error 1053: The service did not respond to the start or control request in a timely fashion" error message when you stop or pause a managed Windows service

    http://support.microsoft.com/kb/839174

     

    You receive an "Error 1053: The service did not respond to the start or control request in a timely fashion" error message when a service that uses the local system account tries to start on a Windows Server 2003-based computer

    http://support.microsoft.com/kb/886695

     

    For further assistance about the coding issue, please refer to Microsoft Developer Network Forum below:

    http://social.msdn.microsoft.com/Forums/en/categories/

     

    Regards,


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, October 11, 2010 7:15 AM
    Moderator

All replies

  • Hi,

     

    I would like to suggest you check if the following Microsoft KB articles are helpful:

     

    FIX: You receive an "Error 1053: The service did not respond to the start or control request in a timely fashion" error message when you stop or pause a managed Windows service

    http://support.microsoft.com/kb/839174

     

    You receive an "Error 1053: The service did not respond to the start or control request in a timely fashion" error message when a service that uses the local system account tries to start on a Windows Server 2003-based computer

    http://support.microsoft.com/kb/886695

     

    For further assistance about the coding issue, please refer to Microsoft Developer Network Forum below:

    http://social.msdn.microsoft.com/Forums/en/categories/

     

    Regards,


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
    Monday, October 11, 2010 7:15 AM
    Moderator
  •  

    Operating system expect OnStart to return in a short amount of time, you should create thread in onstart.  

     

     

    protected override void OnStart(string[] args)

    {

    Thread t = new Thread(new ThreadStart(MethodName));

    t.Start();

    }

    Try this way it should work.

     

    Friday, March 18, 2011 9:43 AM