.NET Framework Developer Center >
.NET Development Forums
>
.NET Base Class Library
>
Error 1053: The service did not respond to the start or control request in a timely fashion.
Error 1053: The service did not respond to the start or control request in a timely fashion.
- I had created one windows service-"DayBegin" which executes a batch file. When I am trying to start the service it throws an alert "Could not start the DayBegin service on local computer. Error 1053: The service did not respond to the start or control request in a timely fashion. This batch files works fine when executed directly and from the schedular aswell. I have tried this on both Windows XP Professional and Windows server 2003 but throwing same exception.
Thanks in advance.
Chandra- Moved byVMazurMVP, ModeratorFriday, November 06, 2009 11:19 AM (From:ADO.NET Data Providers)
Answers
- Hello Chandra,I would suggest a service debug approach like the following:Put a Thread.Sleep(15000) into the start of your service. Start the service, then, in the IDE, attach your debugger to the service. Have a breakpoint ready *after* the Thread.Sleep, and when the 15 seconds is up, you'll be able to debug.What does the batch file do? If it's trying to access network resources or paths you might be getting a security error. Have a look in your Event Viewer in Windows for more information.Hope this helps!Cheers,-jc
Me, coding and stuff: Mr. James- Marked As Answer byeryangMSFT, ModeratorWednesday, November 11, 2009 10:05 AM
- This is the kind of thing you get when you decide to do something in the OnStart type of service method and it crashes. Windows expects you to return and you didn't. This is most likely a case where you must handle any possible exceptions that your code might get. Services can report this type of error in an event log. There's also no reason you can't use a TraceListener to write to a text file to trace the flow of your code.
Phil Wilson- Marked As Answer byeryangMSFT, ModeratorWednesday, November 11, 2009 10:05 AM
All Replies
- Hello Chandra,I would suggest a service debug approach like the following:Put a Thread.Sleep(15000) into the start of your service. Start the service, then, in the IDE, attach your debugger to the service. Have a breakpoint ready *after* the Thread.Sleep, and when the 15 seconds is up, you'll be able to debug.What does the batch file do? If it's trying to access network resources or paths you might be getting a security error. Have a look in your Event Viewer in Windows for more information.Hope this helps!Cheers,-jc
Me, coding and stuff: Mr. James- Marked As Answer byeryangMSFT, ModeratorWednesday, November 11, 2009 10:05 AM
- This is the kind of thing you get when you decide to do something in the OnStart type of service method and it crashes. Windows expects you to return and you didn't. This is most likely a case where you must handle any possible exceptions that your code might get. Services can report this type of error in an event log. There's also no reason you can't use a TraceListener to write to a text file to trace the flow of your code.
Phil Wilson- Marked As Answer byeryangMSFT, ModeratorWednesday, November 11, 2009 10:05 AM
- What account is the service running under? Does it have access to the batch file and any other filesystem objects it would need?


