14

I have done some Researching and implemented some additions from the Questions that I found here on StackOverFlow. but I am still having issues with the service not auto-starting

here are some of the Questions/Answers that I have read

  1. How To Auto Start Windows Service
  2. Automatically start a windows Service on install
  3. Auto Start Windows Services through installer in vs net 2008
  4. How to Automatically start your service after install

I set the Start Type in my Installer code

I set the after install Code

I tested by rebooting, nothing.

uninstalled, re installed, started service and then reboot again, service didn't auto start on reboot.

I made sure every time I made a change that I did a rebuild on the project and the setup project before a fresh install.

I am not finding much for my current situation, when searching Google either.

am I missing something?

Community
  • 1
  • 1
Malachi
  • 3,205
  • 4
  • 29
  • 46

2 Answers2

12

If your service StartType is set to Automatic, but the service is not running after a reboot, then either your service has a dependency on another service that is not starting correctly, or your service's own startup code is failing and ends up stopping the service. Check the Windows Event Log for errors (if you are not logging your own errors, you should be).

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 7
    This is not necessarily the case. My service has no dependencies and has been working fine for the last 10 years. Then yesterday I updated to 1703 (Creators Update), and now it doesn't start on boot; but it can still be started manually. – Martin Argerami Sep 16 '17 at 10:34
  • They suggest that you use als startup: Automatic (delayed). May be not everything is loaded at the point you want to start your service. With Automatic (delayed) your service will be started last in line. – Herman Van Der Blom Jan 21 '19 at 14:17
4

Go to your windows services, right click --> Properties, and then select Startup type to Automatic.

Jeff
  • 972
  • 5
  • 11
  • 2
    Are you logging? I would imagine if it is set to automatic and it is not restarting that there would be an exception somewhere. – Jeff Apr 18 '13 at 21:27
  • I am using Top Shelf 3.2. I suspect your application might be dependent on the event log service if you are logging. In top shelf the code is DependsOnEventLog() – Rudy Hinojosa Apr 17 '18 at 13:59