Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. 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

Scheduled Pinned Locked Moved C#
helpcsharpdebuggingquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    obrix_activex
    wrote on last edited by
    #1

    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

    N N 2 Replies Last reply
    0
    • O obrix_activex

      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

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      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

      O 1 Reply Last reply
      0
      • N N a v a n e e t h

        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

        O Offline
        O Offline
        obrix_activex
        wrote on last edited by
        #3

        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!

        P 1 Reply Last reply
        0
        • O obrix_activex

          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!

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          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.

          O 1 Reply Last reply
          0
          • P PIEBALDconsult

            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.

            O Offline
            O Offline
            obrix_activex
            wrote on last edited by
            #5

            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 :)

            1 Reply Last reply
            0
            • O obrix_activex

              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

              N Offline
              N Offline
              Narendra Reddy Vajrala
              wrote on last edited by
              #6

              Hi Obrix! m also facing the same short of problem to windows service did u got solution?? please share :)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups