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

时光怂恿深爱的人放手 提交于 2020-01-06 08:23:29

问题


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.


回答1:


I'm 99% sure that you can solve this by granting the Log on as service privilege to the administrator user.



来源:https://stackoverflow.com/questions/5230353/trying-to-start-a-new-service-but-having-a-permission-problem

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