Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows Service Error 1053
    primarykey
    data
    text
    <p>I'm currently writing a windows service which connects to a crm system to pull down a schedule which then runs various datafeeds etc. I've got everything working except when I install everything and try to run start the service I get the following error :</p> <p>"Error 1053: The service did not respond to the start or control request in a timely fashion"</p> <p>Here's the code I'm using in my Service1.cs;</p> <pre><code>namespace FeedManagementService { public partial class Service1 : ServiceBase { private System.Timers.Timer timer; public Service1() { InitializeComponent(); } protected override void OnStart(string[] args) { // Instantiate the timer Thread t = new Thread(new ThreadStart(this.InitTimer)); t.IsBackground = true; t.Start(); } // OnStart protected override void OnStop() { timer.Enabled = false; } // OnStop private void InitTimer() { timer = new System.Timers.Timer(); // Add the timer event timer.Elapsed += new ElapsedEventHandler(timerTick); // Set the interval double timeInSeconds = 6.0; timer.Interval = (timeInSeconds * 1000); timer.Enabled = true; } // InitTimer() private void timerTick(object sender, EventArgs e) { // CRM connection stuffhere } // timerTick } } </code></pre> <p>Then the following in the Service1.Designer.cs</p> <pre><code>namespace FeedManagementService { partial class Service1 { /// &lt;summary&gt; /// Required designer variable. /// &lt;/summary&gt; private System.ComponentModel.IContainer components = null; /// &lt;summary&gt; /// Clean up any resources being used. /// &lt;/summary&gt; /// &lt;param name="disposing"&gt;true if managed resources should be disposed; otherwise, false.&lt;/param&gt; protected override void Dispose(bool disposing) { if (disposing &amp;&amp; (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Component Designer generated code /// &lt;summary&gt; /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// &lt;/summary&gt; private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.ServiceName = "Feed Management Service"; this.CanPauseAndContinue = true; } // InitializeComponent() #endregion } } </code></pre> <p>And lastly the following in ProjectInstaller.cs</p> <pre><code>namespace FeedManagementService { [RunInstaller(true)] public partial class ProjectInstaller : System.Configuration.Install.Installer { public ProjectInstaller() { ServiceProcessInstaller process = new ServiceProcessInstaller(); process.Account = ServiceAccount.LocalSystem; ServiceInstaller serviceAdmin = new ServiceInstaller(); serviceAdmin.StartType = ServiceStartMode.Manual; serviceAdmin.ServiceName = "Service1"; serviceAdmin.DisplayName = "Feed Management Service"; Installers.Add(process); Installers.Add(serviceAdmin); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload