Windows 服务不会自动启动 [英] Windows Service doesn't start automatically

查看:74
本文介绍了Windows 服务不会自动启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

据我所知,这可能是由于我的服务的依赖项在服务尝试启动时没有启动.我不知道我的服务依赖什么.我通过添加 windows 打印后台处理程序作为我的服务的依赖项之一来尝试解决方法,因为打印后台处理程序是在启动期间启动很晚的服务之一.嗯,解决方法也不起作用.

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.

我使用的是 Windows Server 2003 r2.所以延迟自动重启"选项对我不可用.我不能为此使用 Windows Server 2008.

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.

推荐答案

一些可以尝试的建议:

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

这篇关于Windows 服务不会自动启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆