【发布时间】:2014-07-04 14:39:08
【问题描述】:
在我属于管理员组的 Windows 8.1 计算机上托管 WCF Net.Tcp 服务时出现以下错误: 服务端点未能侦听 URI 'net.tcp://localhost:9001/dataservice',因为访问被拒绝。验证当前用户是否在 SMSvcHost.exe.config 的相应 allowAccounts 部分中被授予访问权限。
我什至按照建议将用户添加到配置中:
<?xml version="1.0" encoding="utf-8"?>
<!-- The configuration file for SMSvcHost.exe -->
<configuration>
<runtime>
<gcConcurrent enabled="false" />
</runtime>
<system.serviceModel>
<!-- SMSvcHost ETW traces are redirected by default to an etwProviderId different from WCF's default.
To trace to the default provider, remove the etwProviderId attribute below. -->
<diagnostics performanceCounters="Off" etwProviderId="{f18839f5-27ff-4e66-bd2d-639b768cf18b}"/>
</system.serviceModel>
<system.serviceModel.activation>
<net.tcp listenBacklog="10" maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10" teredoEnabled="false">
<allowAccounts>
<add securityIdentifier="S-1-5-18"/>
<add securityIdentifier="S-1-5-19"/>
<add securityIdentifier="S-1-5-20"/>
<add securityIdentifier="S-1-5-32-544" />
<add securityIdentifier="S-1-5-21-2476327175-1934278006-4092406606"/>
</allowAccounts>
</net.tcp>
<net.pipe maxPendingConnections="100" maxPendingAccepts="2" receiveTimeout="00:00:10">
<allowAccounts>
<add securityIdentifier="S-1-5-18"/>
<add securityIdentifier="S-1-5-19"/>
<add securityIdentifier="S-1-5-20"/>
<add securityIdentifier="S-1-5-32-544" />
<add securityIdentifier="S-1-5-21-2476327175-1934278006-4092406606"/>
</allowAccounts>
</net.pipe>
<diagnostics performanceCountersEnabled="true" />
</system.serviceModel.activation>
</configuration>
但仍然出现相同的错误,这可以正常工作,无需在 W7 机器上更改配置,有什么想法吗?
【问题讨论】:
标签: c# .net wcf nettcpbinding