I have a service installed, and I am trying to start it with the code below:
ServiceController serviceController = new ServiceController("My.Service");
serviceController.Start();
Now if the Service is set with a StartType of “Manual”, this works perfectly. However if the StartType is set to “Automatic”, it does nothing. No errors, no exceptions, it just does not work.
How do I get around this?
if the service can run in manual mode, consider the other controllable aspects of the service, such as the account under which the service executes (LocalSystem or some other account?).
Please set the account type to local service during edit of windows service as below:
Hope this will help you……..