Windows Service doesn't start automatically

大兔子大兔子 提交于 2019-12-07 13:24:19

问题


I have a windows service written in .Net 3.5 set to be automatically start, but it wouldn't start when system reboots.

As I understand, it may be caused by my service's dependency aren't started when the services tries to start. I don't know what my service depends on. I tried the workaround by adding windows print spooler as one of my service's dependencies, since print spooler is one of the services start quite late during the boot-up. Well, the work around doesn't work neither.

I'm using windows server 2003 r2. so the "delayed automatically restart" option is not available to me. and I can't use windows server 2008 just for this.

I'm out of ideas at the moment. Any suggestion would be appreciated.


回答1:


A few suggestions to try out:

  • Check the system even logs
  • Add logging to your service, e.g. to system event log or use log4net
  • Strip the service down to a single message in the start-up or create a new stripped-down minimal service with as little dependencies as possible. See whether this starts
  • Check under which account your service is running and whether this account has the permission to "Run As A Service"


来源:https://stackoverflow.com/questions/3411044/windows-service-doesnt-start-automatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!