[英]Windows Service failes to start with “Path '.' not found”
Disclaimer: the error message is translated from Swedish (and it's a pain to find the exact corresponding error message in English, Microsoft take note...) The error message could also be "Path ' ' not found" or "Path not found". 免责声明:错误消息是从瑞典语翻译而来的(很难找到英文对应的错误消息,Microsoft注意...)。错误消息也可能是“找不到路径'或“找不到路径” 。 It's a bit unclear due to the Swedish message not enclosing the path in ' '. 由于瑞典语消息未将路径包含在“”中,因此尚不清楚。
This is similar to this question, but not exactly: New Windows Service installed, fails to start: "System error 2 ... system cannot find the file specified" 这类似于此问题,但不完全相同: 安装了新的Windows服务,无法启动:“系统错误2 ...系统找不到指定的文件”
I have written the service myself. 我自己写了服务。 It is an exe written in unmanaged C++ and is using the following external code: 它是一个用非托管C ++编写的exe,并使用以下外部代码:
The problem I'm having is that it doesn't start when Windows starts, but it does start if I manually start it! 我遇到的问题是Windows启动时无法启动,但是如果我手动启动,它会启动! I am stumped as to what could be wrong. 我为可能出什么问题而感到困惑。 The only thing I can think of is if perhaps the dll can't be found, but I don't know why it wouldn't. 我唯一能想到的是,也许找不到dll,但我不知道为什么找不到它。 Something with the environment variables being different perhaps? 环境变量可能有所不同吗?
What I have tried: 我尝试过的
For posterity it seems like the delayed start suggested by 51k seems to work. 对于后代来说,似乎51k建议的延迟启动似乎有效。 I don't know why that should make any difference, but as long as it works I'm happy. 我不知道为什么那应该有什么不同,但是只要能奏效,我就会很高兴。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.