Wcf 协议';net.tcp';不支持

Wcf 协议';net.tcp';不支持,wcf,wcf-binding,Wcf,Wcf Binding,我的WCF服务给了我 “不支持协议'net.tcp'。” 您缺少nettcp的基址-或者您需要在端点中定义完整的nettcp地址。您当前的netTcp端点如下所示: <endpoint address="" binding="netTcpBinding" 现在可以在net上访问net.tcp端点。tcp://localhost:8888/JMSysSplashServer 解决方案2:在网络中定义完整地址。Tcp端点: <services> <s

我的WCF服务给了我 “不支持协议'net.tcp'。”


您缺少nettcp的基址-或者您需要在端点中定义完整的nettcp地址。您当前的netTcp端点如下所示:

       <endpoint address="" binding="netTcpBinding" 
现在可以在
net上访问net.tcp端点。tcp://localhost:8888/JMSysSplashServer

解决方案2:在网络中定义完整地址。Tcp端点:

<services>
    <service name="JMSysSplash.CommunicationServer.JMSysSplashServer" 
             behaviorConfiguration="Service1Behavior">
        <endpoint address="" binding="wsHttpBinding" 
                  contract="JMSysSplash.CommunicationClient.IJMSysSplashServer">
            <identity>
                <dns value="localhost"/>
            </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding"  
                  contract="IMetadataExchange"/>
        <endpoint 
             address="net.tcp://localhost:8888/JMSysSplashServer" 
             binding="netTcpBinding" bindingConfiguration="tcpBinding"  
             contract="JMSysSplash.CommunicationClient.IJMSysSplashServer"/>
        .......
    </service>
</services>

.......
定义端点时,您可以

  • 定义一个完整地址(使用
    net.tcp
    和端口号以及全部)
或:

  • 您定义了一个相对地址(例如
    address=“
    ),但在这种情况下,必须具有该方案的基址(此处:
    net.tcp
    ),而不仅仅是http基址

请检查是否安装了“.NET功能->WCF激活->非HTTP激活”功能(“服务器管理器->添加/删除功能”)。我假设您在IIS中托管服务。在这种情况下,还请检查网站(网站->高级设置->启用的协议)是否允许使用net.tcp协议,并且“net.tcp Listner Adapter”windows服务正在运行。

您没有提到谁是主机。如果您使用IISExpress托管,请注意它不支持net.tcp。发件人:
问:是否支持WCF应用程序


答:是的,IIS Express支持WCF应用程序。如上所述,WCF仅在HTTP或HTTPS上受支持。不支持MSMQ和net.tcp上的WCF。

我知道这是一个古老的问题,并且得到了解答,但我遇到了一个类似的问题,解决方法不同

虽然Danil是正确的,但是错过安装会导致同样的错误弹出。我的问题有点不同,为了其他人的利益写下这个答案

问题1 在应用程序所在网站的IIS中,右键单击并单击“编辑绑定”

确保net.tcp作为绑定信息设置为“808:*”的绑定之一存在

问题2 在IIS中的应用程序节点中,转到其“高级设置”并检查net.tcp是否在启用的协议列表中。e、 如果您需要支持后两种协议,“http,net.tcp”就可以使用

希望这有帮助

<services>
    <service name="JMSysSplash.CommunicationServer.JMSysSplashServer" behaviorConfiguration="Service1Behavior">
        .....
        <host>
            <baseAddresses>
                <add baseAddress="http://localhost:8731/JMSysSplashServer.svc/"/>
                <add baseAddress="net.tcp://localhost:8888/JMSysSplashServer"/>
            </baseAddresses>
        </host>
    </service>
</services>
<services>
    <service name="JMSysSplash.CommunicationServer.JMSysSplashServer" 
             behaviorConfiguration="Service1Behavior">
        <endpoint address="" binding="wsHttpBinding" 
                  contract="JMSysSplash.CommunicationClient.IJMSysSplashServer">
            <identity>
                <dns value="localhost"/>
            </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding"  
                  contract="IMetadataExchange"/>
        <endpoint 
             address="net.tcp://localhost:8888/JMSysSplashServer" 
             binding="netTcpBinding" bindingConfiguration="tcpBinding"  
             contract="JMSysSplash.CommunicationClient.IJMSysSplashServer"/>
        .......
    </service>
</services>