I write it. Usually it worked fine on Windows 8, but after installing Visual Studio 2017 on a new VM it refuses to start after 3 or 4 seconds. I write a new one this is on_start() method:
protected override void OnStart(string[] args)
{
RequestAdditionalTime(5000);
try
{
this.EventLog.WriteEntry("Service started.", EventLogEntryType.SuccessAudit);
}
catch (Exception ex)
{
this.EventLog.WriteEntry("CUSTOM ERROR: " + ex.Message, EventLogEntryType.Error);
}
}