简体   繁体   English

如何在管理员模式下启动Windows服务

[英]How to Start Windows Service in Administrator Mode

i bet its pretty easy question , any way im trying to run a windows service which host WCF service in administrator mode! 我敢打赌,这是一个非常简单的问题,无论如何,我想以管理员模式运行运行WCF服务的Windows服务!

i keep getting the exception of : 我不断得到例外:

HTTP could not register URL http://+:8000/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details)

i know its something has to do with the fact that windows doesnt start process services in admin mode but instead it start it in standard mode unless you specify the oppsite 我知道它与Windows不在管理员模式下启动进程服务有关,而是在标准模式下启动它,除非您指定oppsite

any help on how to start it in admin mode ? 任何有关如何以管理员模式启动的帮助?

i guess this 我猜这个

netsh http add urlacl url=http://+:80/MyUri user=DOMAIN\user

fixed it but now i have a new exception any way i will look for the new exception and iw ill feed back if its something else. 修复了它,但是现在我有一个新的例外,无论如何我都会寻找新的例外,如果有其他事情我会反馈的。

It would be inadvisable to run a service under admin mode simply to get an Url reservation on the Http pipeline. 仅在Http管道上获取Url保留,在admin模式下运行服务是不明智的。 When you come to writing an installer, you can automate creation of the reservation in code. 编写安装程序时,可以在代码中自动创建保留。 Here's a link that will help you: urlreservation.codeplex.com 这是一个对您有帮助的链接: urlreservation.codeplex.com

使用以下短语将清单添加到托管的WCF服务:

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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