简体   繁体   中英

Trying to start a new service - but having a permission problem

The error:

I get a popup window when trying to manually start the windows service. It says:

Windows could not start the XXX service on Local Computer. Error: 1069: The service did not start due to a logon failure.

Post-build events:

There are 2 Windows services in the solution and they have the same post-build events:

REM C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe /u  "$(TargetPath)"
REM C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe /i /username=.\administrator /password=blabla "$(TargetPath)"

But for some reason it's only the first service that is installed during debug-build mode. The other is not (despite similar post-build events). So I manually used the InstallUtil with the administrator login and blabla password from the post-build events. That did install it, but one is installed with "Log On As = Local System" (works!) and the other has "Log On As = .\\administrator" (does not work!).

I guess that's what triggers the error. Why the difference? Is there another install going on the solution build somewhere? It should be said that it is a solution consisting of 47 projects.

我99%的确定您可以通过将“作为服务登录”特权授予管理员用户来解决此问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM