Note that there are some explanatory texts on larger screens.

plurals
  1. PODeveloping service in .NET Framework 4, Error 1053
    primarykey
    data
    text
    <p>So I'm trying to run a service I programmed and for some reason it's giving me this error when try I start it:</p> <pre><code>Error 1053: the service did not respond to the start or control request in a timely fashion </code></pre> <p>My code is pretty basic.</p> <pre><code>static void Main(string[] args) { try { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new Program() }; ServiceBase.Run(ServicesToRun); } catch (Exception ex) { string SourceName = "WindowsService.ExceptionLog"; if (!EventLog.SourceExists(SourceName)) { EventLog.CreateEventSource(SourceName, "Application"); } EventLog eventLog = new EventLog(); eventLog.Source = SourceName; string message = string.Format("Exception: {0} \n\nStack: {1}", ex.Message, ex.StackTrace); eventLog.WriteEntry(message, EventLogEntryType.Error); } } public Program() { this.ServiceName = "FetchFeed"; } protected override void OnStart(string[] args) { base.OnStart(args); //TODO: place your start code here repeat: FetchFeed(); Thread.Sleep(3600000); goto repeat; } protected override void OnStop() { base.OnStop(); //TODO: clean up any variables and stop any threads } private static void FetchFeed() { //Some HTTP requests and retrieval. } </code></pre> <p>and this is the Installer Class:</p> <pre><code>[RunInstaller(true)] public class Service_Installer : Installer { public Service_Installer() { ServiceProcessInstaller processInstaller = new ServiceProcessInstaller(); ServiceInstaller serviceInstaller = new ServiceInstaller(); //set the privileges processInstaller.Account = ServiceAccount.LocalSystem; serviceInstaller.DisplayName = "FetchFeed"; serviceInstaller.StartType = ServiceStartMode.Manual; //must be the same as what was set in Program's constructor serviceInstaller.ServiceName = "FetchFeed"; this.Installers.Add(processInstaller); this.Installers.Add(serviceInstaller); } } </code></pre> <p>What could be the the reason behind the error? I have checked the FetchFeed() to be working as a standalone application with no Exceptions.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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