Windows 服务不会自动启动

发布于 2024-09-13 02:57:08 字数 311 浏览 2 评论 0原文

我有一个用 .Net 3.5 编写的 Windows 服务,设置为自动启动,但系统重新启动时它不会启动。

据我了解,这可能是由于当服务尝试启动时我的服务的依赖项未启动所致。我不知道我的服务取决于什么。我尝试了解决方法,将 Windows 打印后台处理程序添加为我的服务的依赖项之一,因为打印后台处理程序是在启动过程中启动得很晚的服务之一。好吧,解决办法也不起作用。

我使用的是 Windows Server 2003 R2。所以“延迟自动重启”选项对我不可用。我不能仅仅为此使用 Windows Server 2008。

我现在没有主意了。任何建议将不胜感激。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

逆夏时光 2024-09-20 02:57:08

可以尝试的一些建议:

  • 检查系统甚至日志
  • 将日志记录添加到您的服务,例如系统事件日志或使用 log4net
  • 在启动时将服务精简为单个消息,或使用 as 创建一个新的精简最小服务尽可能少的依赖性。查看是否启动
  • 检查您的服务在哪个帐户下运行以及该帐户是否具有“作为服务运行”的权限

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"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文