我想使用netTCPbinding,所以我改变了我的网络配置,如下所示。我遇到了这个错误:
无法找到与绑定NetTcpBinding的端点匹配scheme net.tcp的基址。注册的基地址方案是[http]。
如何解决这个问题?
<services>
<service name="DXDirectory.DXDirectoryService" behaviorConfiguration="DXDirectory.Service1Behavior">
<!-- Service Endpoints -->
<endpoint address="" binding="netTcpBinding" bindingConfiguration="WindowsSecured" contract="DXDirectory.IDXDirectoryService">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:2582/DXDirectoryService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DXDirectory.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="false" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false" />
<serviceAuthorization principalPermissionMode="UseWindowsGroups" />
<!--<serviceCredentials>-->
<!--<userNameAuthentication userNamePasswordValidationMode="Custom"
membershipProviderName="CustomUserNameValidator"/>-->
<!--</serviceCredentials>-->
</behavior>
</serviceBehaviors>
</behaviors>
答案 0 :(得分:5)
HMm ...您已将基地址添加到服务/主机部分确定。
快速提问:你是自托管,还是在IIS托管?哪个版本的IIS ??
IIS5 / 6仅支持HTTP连接 - 您无法在IIS 5/6中托管NetTCP。
在IIS7中,您必须手动执行一系列步骤以启用非HTTP绑定,但这是可能的。请参阅this MSDN article了解如何实现这一目标。
自托管是最佳选择 - 您可以获得所有绑定,并完全控制您托管的服务。
马克
答案 1 :(得分:4)
答案 2 :(得分:0)
我无法看到配置文件中的部分,请你 请加上这个
<netTcpBinding>
<binding name="WindowsSecured">
<security mode="none"/>
</binding>
</netTcpBinding>