我想使用netTCPbinding,所以我改变了我的web配置,如下所示.我遇到了这个错误:
Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [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>
解决方法
HMm …你已经将基地址添加到你的服务/主机部分了.
快速提问:你是自托管,还是在IIS托管?哪个版本的IIS?
IIS5 / 6仅支持HTTP连接 – 您无法在IIS 5/6中托管NetTCP.
在IIS7中,您必须手动执行一系列步骤以启用非HTTP绑定,但这是可能的.有关如何实现此目的,请参阅this MSDN article.
自托管是最佳选择 – 您可以获得所有绑定,并完全控制您托管的服务.
渣
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。