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

  • Question

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

    I have Windowservice on .net 4,I install this WS and when try to start it manually it thow up the above error.

    Below is the code for my installer as well as service class

    namespace HealthFusionWindowService
    {
        using System;
        using System.ComponentModel;
        using System.Configuration.Install;
        using System.ServiceProcess;

        [RunInstaller(true)]
        public class ProjectInstaller : Installer
        {
            private IContainer components = null;
            private ServiceInstaller serviceInstaller1;
            private ServiceProcessInstaller serviceProcessInstaller1;

            public ProjectInstaller()
            {
                this.InitializeComponent();
            }

            protected override void Dispose(bool disposing)
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
                base.Dispose(disposing);
            }

            private void InitializeComponent()
            {
                this.serviceProcessInstaller1 = new ServiceProcessInstaller();
                this.serviceInstaller1 = new ServiceInstaller();
                this.serviceProcessInstaller1.Account = ServiceAccount.LocalSystem;
                this.serviceProcessInstaller1.Password = null;
                this.serviceProcessInstaller1.Username = null;
                this.serviceInstaller1.Description = "Health Fusion Integration";
                this.serviceInstaller1.DisplayName = "Health Fusion Integration";
                this.serviceInstaller1.ServiceName = "HFIntegrationService";
                this.serviceInstaller1.StartType = ServiceStartMode.Automatic;
                base.Installers.AddRange(new Installer[] { this.serviceProcessInstaller1, this.serviceInstaller1 });
            }
        }
    }

    ===================================================================================================

    namespace HealthFusionWindowService
    {
        using AdvantrixDBPoolHelper;
        using System;
        using System.ComponentModel;
        using System.ServiceProcess;

        public class HFIntegrationService : ServiceBase
        {
            private IContainer components = null;
            private TimerHandler pooler = null;

            public HFIntegrationService()
            {
                this.InitializeComponent();
                this.pooler = new TimerHandler();
            }

            protected override void Dispose(bool disposing)
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
                base.Dispose(disposing);
            }

            private void InitializeComponent()
            {
                base.ServiceName = "HFIntegrationService";
            }

            protected override void OnStart(string[] args)
            {
                UIHelper.WriteToFile("I am starting", LogFileType.FtpUpload);
              
                // this.pooler.StartTimer();
            }

            protected override void OnStop()
            {
                //this.pooler.StopTimer();
            }
        }
    }

     

    Thursday, August 2, 2012 10:17 AM

Answers

  • Maybe your service exceeds the start up timeout?. You can request additional time with RequestAdditionalTime method, if you know that your startup operation will take time. How UIHelper.WriteToFile execution takes time?  But overall you should start your service as quick as possible.

    Thursday, August 2, 2012 6:37 PM