找不到与绑定NetTcpBinding的端点匹配方案net.tcp的基地址.注册的基址方案为[http] [英] Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http]

查看:108
本文介绍了找不到与绑定NetTcpBinding的端点匹配方案net.tcp的基地址.注册的基址方案为[http]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用http进行这些操作,当我使用net.tcp并添加引用时,出现了类似错误

I have been using http for all these and when i am working with net.tcp and when adding the reference i am getting an error like

找不到与绑定NetTcpBinding的端点匹配方案net.tcp的基地址.注册的基址方案为[http].

Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].

我的web.config

my web.config

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="servicebehave" name="WcfServ.Service1">
        <endpoint address="" binding="netTcpBinding" 
          bindingConfiguration="" name="nettcp" contract="WcfServ.IService1" />

        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
          name="mex" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:51560/Service1.svc" />
           <add baseAddress="http://localhost:8080/Service1.svc"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <bindings>
      <netTcpBinding>
        <binding name="netTcpBinding">
          <security mode="Transport" />
        </binding>
      </netTcpBinding>

    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="servicebehave">
          <!-- 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"/>

        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="false" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

</configuration>

有人可以告诉我我在哪里做错了吗?

Can anybody tell me where i am doing wrong?

推荐答案

您不能在IIS 6下托管net.tcp,它仅支持HTTP.因此,您只能使用HTTP绑定(基本,ws或2007).为了提供net.tcp和其他协议,需要WAS.您可以独立激活它,但我建议您同时将其与IIS 7一起安装(作为它的一部分安装),因为IIS 7还提供了一种便捷的服务管理平台.

You can't host net.tcp under IIS 6, it supports only HTTP(s). So you are limited with HTTP bindings only (basic, ws or 2007). In order to provide net.tcp and other protocols, WAS is required. You can activate it standalone, but I advice you to install it both with IIS 7 (it is installed as a part of it), because IIS 7 gives a convinient service management platform in addition.

另一种解决方案是使用支持tcp协议的ServiceHost类实例更改托管环境,使其成为自托管或服务托管的

Another solution it so change the hosting environment to make it self-hosted or service-hosted, using ServiceHost class instance, which supports tcp protocol.

这篇关于找不到与绑定NetTcpBinding的端点匹配方案net.tcp的基地址.注册的基址方案为[http]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆