如何在已安装的服务上授予对 HTTP 命名空间的权限?
我编写了一个 Windows 服务,它在本地计算机的端口 8003 上打开 WCF 服务。或者至少,应该是这样。由于著名的异常,该服务无法启动:
System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8003/TRConfigurationService/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).
此问题已解决 这里,有一个非常简单的答案:在管理模式下运行命令提示符,然后执行:
netsh http add urlacl url=http://+:8003/ user=DOMAIN\UserName
一切都很好,我可以在本地开发人员上手动执行此操作机器。但是,如何在客户端安装中执行此操作,而无需用户在提示以管理员模式运行时单击“是”(仅在安装后/安装过程中一次)之外执行任何操作?
I have written a Windows Service, that opens up a WCF service on port 8003 of the local machine. Or at least, it's supposed to. The service can't start up, because of the famous exception:
System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8003/TRConfigurationService/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details).
This problem is addressed here, with a very simple answer: run a command prompt in admin mode, and execute:
netsh http add urlacl url=http://+:8003/ user=DOMAIN\UserName
All very well and good, and I can do that manually on my local dev machine. But how do I do that on the client installation, without the user having to do anything other than click "Yes" (only once after/during installation) when prompted to run in Admin mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来你应该能够使用WIX< /a>.
It sounds like you should be able to do it using WIX.
看起来答案只是确保服务在管理模式下运行,那就没有问题了!对于那些不知道的人,请在项目中添加一个app.manifest文件,并设置
Looks like the answer is simply to make sure the service runs in admin mode, then there's no problem! For those who don't know, add an app.manifest file to the project, and set