I went through the Walkthrough: Creating a Windows Service Application in Component Designer on MSDN.
I have a code and my service is installed:

My code is as follows:
namespace WindowsServiceWalkthrough { using System; using System.Diagnostics; using System.ServiceProcess; using System.Timers; using System.Runtime.InteropServices; public partial class MyNewService : ServiceBase { private int _eventId; public MyNewService() { InitializeComponent(); if (! EventLog.SourceExists("MySource")) { EventLog.CreateEventSource( "MySource", "MyNewLog"); } eventLog1.Source = "MySource"; eventLog1.Log = "MyNewLog"; } [DllImport("advapi32.dll", SetLastError = true)] private static extern bool SetServiceStatus(IntPtr handle, ref ServiceStatus serviceStatus); protected override void OnStart(string[] args) { var serviceStatus = new ServiceStatus { dwCurrentState = ServiceState.SERVICE_RUNNING, dwWaitHint = 100000 }; SetServiceStatus(this.ServiceHandle, ref serviceStatus); eventLog1.WriteEntry("My Event Log: In OnStart method", EventLogEntryType.Information); var timer = new Timer(); timer.Interval = 60000;
However, when I try to start the service from the services window, I get the following error:

If I try to start it from the console using net start MyNewService , I get the following error:
The service does not respond to the management function.
For further assistance, call NET HELPMSG 2186.
The help message then looks like a window, i.e.
The service does not respond to the management function.
How can I fix \ debug this?
I am running Windows 8.1 and using .NET 4.5.2
source share