Error 1053: The service did not respond to the start or control request in a timely fashion
-
H! All I have a problem regarding window service. When I tried to start the service from the Services, it gives me an error, "Error 1053: The service did not respond to the start or control request in a timely fashion".. The code uses System.Threading not System.Timer..i tried to put an additional code to produce a log file so that i can see what is happening while starting in the services.., it executed the routine..from OnStart it calls a function and inside the function..it loops continuously..then i think it was five loops when the error showed up..it didnt pass to the OnStop method.. Another thing I am confused is that i can run or double click the EXE in the debug folder manually and it is running successfully. It seems that I am running an ordinary EXE not a windows service EXE.. BTW, this was built in C#.NET.. Anyone who knows this problem..Please help this is urgent.. Thanks in advance..Regards
-
H! All I have a problem regarding window service. When I tried to start the service from the Services, it gives me an error, "Error 1053: The service did not respond to the start or control request in a timely fashion".. The code uses System.Threading not System.Timer..i tried to put an additional code to produce a log file so that i can see what is happening while starting in the services.., it executed the routine..from OnStart it calls a function and inside the function..it loops continuously..then i think it was five loops when the error showed up..it didnt pass to the OnStop method.. Another thing I am confused is that i can run or double click the EXE in the debug folder manually and it is running successfully. It seems that I am running an ordinary EXE not a windows service EXE.. BTW, this was built in C#.NET.. Anyone who knows this problem..Please help this is urgent.. Thanks in advance..Regards
Don't do operations that take long time on your start method. This error comes usually when the service can't start running in 30 seconds. Do all your long running tasks on a separate thread. What is your service doing on startup? Is it reading some files?
Navaneeth How to use google | Ask smart questions
-
Don't do operations that take long time on your start method. This error comes usually when the service can't start running in 30 seconds. Do all your long running tasks on a separate thread. What is your service doing on startup? Is it reading some files?
Navaneeth How to use google | Ask smart questions
Thanks for your reply Navaneeth :) Yes, the OnStart calls a function..here's the sample code.. public void Start() { int intervalEnqueue; try { intervalEnqueue = 600; timer1 = new Timer(new TimerCallback(LLPlusProcess), null, intervalEnqueue, intervalEnqueue); } .....and here are some content of the function..... public void LLPlusProcess(object state) GetSMSResult getIncomingSMSResult = new GetSMSResult(); getIncomingSMSResult = null; service = new Service(); service.Credentials = System.Net.CredentialCache.DefaultCredentials; // get Incoming SMS with Waiting status getIncomingSMSResult = service.GetSMS(System.Configuration.ConfigurationManager.AppSettings["clientAppKey"], System.Configuration.ConfigurationManager.AppSettings["enqueueStatus"], "Waiting", Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["enqueueRecord"])); <---- calls a web service function here string getIncomingSMSResultResponse = getIncomingSMSResult.ResponseMessage; System.Diagnostics.Debug.Write(getIncomingSMSResultResponse + "\r\n"); GetSMSResultMessage[] getIncomingSMSResultMessage = null; getIncomingSMSResultMessage = getIncomingSMSResult.Message; ....etc... If getIncomingSMSResultMessage is NULL then it will go here..else it will save the data in the database.. catch (Exception ex) { System.Diagnostics.Debug.Write("ENQUEUE [EX] : " + ex.ToString()); } System.Threading.Thread.Sleep(100); enqued = false; } else { System.Diagnostics.Debug.Write("\r\n ---- ENQUEUE PROCESS ON GOING ----\r\n "); } It will loop for how many times (as per my log files) but still it will end to error i mentioned.. But if i double click the exe file from debug folder..it run successfully..is it normal for a web service exe to be manually run? Some says it shouldnt be running that way..because exe file will look for the services for it to run... Please help..Regards!
-
Thanks for your reply Navaneeth :) Yes, the OnStart calls a function..here's the sample code.. public void Start() { int intervalEnqueue; try { intervalEnqueue = 600; timer1 = new Timer(new TimerCallback(LLPlusProcess), null, intervalEnqueue, intervalEnqueue); } .....and here are some content of the function..... public void LLPlusProcess(object state) GetSMSResult getIncomingSMSResult = new GetSMSResult(); getIncomingSMSResult = null; service = new Service(); service.Credentials = System.Net.CredentialCache.DefaultCredentials; // get Incoming SMS with Waiting status getIncomingSMSResult = service.GetSMS(System.Configuration.ConfigurationManager.AppSettings["clientAppKey"], System.Configuration.ConfigurationManager.AppSettings["enqueueStatus"], "Waiting", Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["enqueueRecord"])); <---- calls a web service function here string getIncomingSMSResultResponse = getIncomingSMSResult.ResponseMessage; System.Diagnostics.Debug.Write(getIncomingSMSResultResponse + "\r\n"); GetSMSResultMessage[] getIncomingSMSResultMessage = null; getIncomingSMSResultMessage = getIncomingSMSResult.Message; ....etc... If getIncomingSMSResultMessage is NULL then it will go here..else it will save the data in the database.. catch (Exception ex) { System.Diagnostics.Debug.Write("ENQUEUE [EX] : " + ex.ToString()); } System.Threading.Thread.Sleep(100); enqued = false; } else { System.Diagnostics.Debug.Write("\r\n ---- ENQUEUE PROCESS ON GOING ----\r\n "); } It will loop for how many times (as per my log files) but still it will end to error i mentioned.. But if i double click the exe file from debug folder..it run successfully..is it normal for a web service exe to be manually run? Some says it shouldnt be running that way..because exe file will look for the services for it to run... Please help..Regards!
obrix_activex wrote:
is it normal for a web service exe to be manually run?
Not usually, but you can write one that does. What type of Timer are you using? I use a
System.Timers.Timer
for my Services. -
obrix_activex wrote:
is it normal for a web service exe to be manually run?
Not usually, but you can write one that does. What type of Timer are you using? I use a
System.Timers.Timer
for my Services.H! PIEBALDconsult! The program uses System.Threading...You may refer to my previous messages regarding my problem.. I'm confused to where is really the problem occurs..is it in the code or the way i built the service installer? Thanks! Regards :)
-
H! All I have a problem regarding window service. When I tried to start the service from the Services, it gives me an error, "Error 1053: The service did not respond to the start or control request in a timely fashion".. The code uses System.Threading not System.Timer..i tried to put an additional code to produce a log file so that i can see what is happening while starting in the services.., it executed the routine..from OnStart it calls a function and inside the function..it loops continuously..then i think it was five loops when the error showed up..it didnt pass to the OnStop method.. Another thing I am confused is that i can run or double click the EXE in the debug folder manually and it is running successfully. It seems that I am running an ordinary EXE not a windows service EXE.. BTW, this was built in C#.NET.. Anyone who knows this problem..Please help this is urgent.. Thanks in advance..Regards
Hi Obrix! m also facing the same short of problem to windows service did u got solution?? please share :)