一个WCF服务,我已经做出了Windows服务在该主机上http://localhost:8080/SomeService
托管从Windows服务
Windows服务WCF服务被配置为使用网络服务帐户运行。
当我尝试启动服务,我得到以下异常:
System.ServiceModel.AddressAccessDeniedException: 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). --->
System.Net.HttpListenerException: Access is denied
我想要做的是一些代码添加到服务安装程序(内部AfterInstall
例如)为服务提供适当的权利。
这怎么能在C#中完成?
编辑
我知道,这项服务将在XP,Vista和Win7的计算机上安装,所以我需要的东西,在所有这些平台的作品。