All of a sudden my Windows service application after installation does not start. (Some services stop automatically if they have no work to do.)

The service uses a custom user. If I change the logon setting to use the local system account, the service starts fine. Then when I go back and change the login setting to use this custom account (local user -> custom user under user group), the service will start.

Why doesn't it work in the first place?

  • Look in the Windows Exception Log. It could be that you have the username/password for the service wrong and it's failing at login. – Justin Niessner Mar 24 '10 at 15:18
  • when is the service failing? at boot? is it trying to start before some other service it depends on has started? – quack quixote Mar 25 '10 at 8:17

Is the user account disabled?
Does the user account have "User must change password at next logon" checked?
Does the user account have rights to run as a service?

| improve this answer | |
  • 1. User is not disabled 2. nope, set to password never expires 3. user is create for running the service so it has all rights, only confusing point is how does the same user and password works fine after running the service once with local user? – Gauls Jul 2 '10 at 10:04
  • Doesn't give any exceptions in the log, service is failing when trying to start just after installer has finished installing the service or anytime the service is stopped and started again. – Gauls Jul 2 '10 at 10:05

In my case it was caused by user not having "Logon as a service permission" in computer policies, so after restart Windows will fail to start the service.

For more information, refer to this MSDN question

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.