netsh不适用于AddressAccessDeniedException:HTTP无法注册URL

问题描述

|| 当另一位开发人员尝试通过vs 2010运行该服务时,他们收到错误消息:
Please try changing the HTTP port to 88 or running as Administrator.
System.ServiceModel.AddressAccessDeniedException: HTTP Could not register URL http://+:88/ColorService/. 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
经过一些搜索并转到了Microsoft指定的链接之后,我让他们运行以下命令: netsh http添加urlacl url = http:// +:88 / ColorService user = BUILTIN \\ Administrators 错误仍然出现,因此我也让他们使用其Domain \\ User运行命令 netsh http添加urlacl url = http:// +:88 / ColorService user = DOMAIN \\ User 上面的命令仍然无效,因此我在下面的链接中找到了一个工具,尝试并授予对NT Authority \\ Interactive的访问权限,但这也不起作用。 我终于回到了给每个端点一个基址的位置:
http:\\\\localhost:8732\\Design_Time_Addresses\\ColorService
,此后有效。 为什么它不能与其他基址一起使用? 我在每个端点内也没有任何dns节点,这有关系吗?这是做什么用的?我将其添加为:
 <Host>
     <dns>localhost<dns/>
 </Host> 
    

解决方法

        我有这个错误。我在app.config中使用以下端点配置了它:
<host>
<baseAddresses>
    <add baseAddress=\"http://ttintlonape01:6970/janus/data\" />
</baseAddresses>
...但是它是由您得到的http:// +:80 / janus / data提出的。 事实证明,WCF会自动放入端点(不确定何时)-向配置中添加修复它。即
<service behaviorConfiguration=\"ServiceBehavior\" name=\"TT.Janus.Service.DataProvider\">
<clear />
<endpoint address=\"net.tcp://ttintlonape01/janus/data\" binding=\"netTcpBinding\"
    bindingConfiguration=\"NoSecurityBinding\" contract=\"TT.Janus.Service.IDataProvider\" />
<endpoint address=\"mex\" binding=\"mexHttpBinding\" bindingConfiguration=\"\" contract=\"IMetadataExchange\" />
<host>
    <baseAddresses>
        <add baseAddress=\"http://ttintlonape01:6969/janus/data\" />
    </baseAddresses>
</host>