C# 找不到与scheme net.tcp匹配的基址

C# 找不到与scheme net.tcp匹配的基址,c#,wcf,duplex,net.tcp,C#,Wcf,Duplex,Net.tcp,我已将文件传输服务从basicHttpBinding移动到netTcpBinding 因为我正在尝试设置双工模式通道。我还启动了我的net.tcp 端口共享服务 我目前在开发环境中,在移动设备之前,我一直在xp设备上自我托管 应用程序到开发服务器。因此,目前我没有访问IIS的权限 将我的服务配置为以下内容后: <service behaviorConfiguration="transferServiceBehavior" name="API.FileTransfer.FileTransfe

我已将文件传输服务从basicHttpBinding移动到netTcpBinding 因为我正在尝试设置双工模式通道。我还启动了我的net.tcp 端口共享服务

我目前在开发环境中,在移动设备之前,我一直在xp设备上自我托管 应用程序到开发服务器。因此,目前我没有访问IIS的权限

将我的服务配置为以下内容后:

<service behaviorConfiguration="transferServiceBehavior" name="API.FileTransfer.FileTransferService">
        <endpoint name="MyFileTransferEP"
                  address  = ""
                  binding  = "netTcpBinding"
                  bindingConfiguration="MyFileTransferNetTcpEP"
                  behaviorConfiguration="NetTcpEPBehavior"
                  contract="API.FileTransfer.IFileTransferService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8001/project/filetransfer.svc" />
          </baseAddresses>
        </host>
</service>

我的约束力如下:

<netTcpBinding>
        <binding name="MyFileTransferNetTcpEP"
                 hostNameComparisonMode="StrongWildcard"
                 closeTimeout="00:01:00"
                 openTimeout="00:01:00" 
                 receiveTimeout="00:10:00" 
                 sendTimeout="00:01:00"
                 maxReceivedMessageSize="2147483647"
                 transferMode="Streamed"
                 portSharingEnabled="true">
          <security mode="None">
            <transport clientCredentialType="None" />
            <message clientCredentialType="None" />
          </security>
        </binding>
</netTcpBinding>

当我右键单击并浏览SVC文件时,出现以下错误:

找不到一个 与的scheme net.tcp匹配 绑定为NetTcpBinding的终结点。 注册基址方案包括 [http]

在线阅读表明,为了解决这个问题,我 需要将net.tcp绑定添加到应用程序的绑定 在IIS中。但是,如果我是自托管并且没有访问权限,我该怎么办 IIS??顺便说一句,如果您正在阅读本文并且“确实”拥有IIS,请执行以下操作: 右键单击IIS->管理应用程序-> 高级设置。在启用的协议部分,添加net.tcp

有什么想法吗


更新:我想我已经让它工作了,但它仍然不工作。以下是我现在拥有的: 我仍然收到“找不到与scheme net.tcp匹配的基址”错误。 为了反映你的建议,我已经更改了所有的基本地址。以下是我现在拥有的:

<service behaviorConfiguration="transferServiceBehavior" name="API.FileTransfer.FileTransferService">
            <endpoint name="MyJSONFileTransferEP"
                      address="json"
                      binding="webHttpBinding"
                      bindingConfiguration="jsonWeb"
                      behaviorConfiguration="WebHttpEPBehavior"
                      contract="API.FileTransfer.IJSONFileTransferService" />
            <endpoint name="MyPOXFileTransferEP"
                      address="pox"
                      behaviorConfiguration="WebHttpEPBehavior"
                      binding="webHttpBinding"
                      bindingConfiguration="poxWeb"
                      contract="API.FileTransfer.IPOXFileTransferService" />
            <endpoint name="MySOAPFileTransferEP"
                      address="filetransfer"
                      binding="netTcpBinding"
                      bindingConfiguration="netTcpWeb"
                      behaviorConfiguration="NetTcpEPBehavior"
                      contract="API.FileTransfer.ISOAPFileTransferService" />
            <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/>
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://localhost:2544/filetransfer/" />
              </baseAddresses>
            </host>
          </service>

我试过这两个“网”。tcp://localhost:2544“&”网。tcp://localhost:8001". 我是否需要在防火墙设置中添加(允许)内容?还有其他建议吗

以下是我的App.config文件中我的filetransferservice的mexTcpBinding:

<endpoint address="net.tcp://localhost:2544/filetransfer/mex"
        binding="mexTcpBinding" bindingConfiguration="" contract="IMetadataExchange"
        name="filetransfermex">
        <identity>
          <certificateReference storeName="My" storeLocation="LocalMachine"
            x509FindType="FindBySubjectDistinguishedName" />
        </identity>
      </endpoint>

我仍然无法在我的web应用中引用我的FileTransferServiceClient


再次感谢

您只需要为您的服务定义基址(而不是整个地址),然后在服务端点中定义其余地址。文件末尾的
filetransfer.svc
文件的地址不是有效的基址(实际上是文件地址)

由于这是net.tcp并且您是自托管的,所以根本不需要svc文件

更新:如果希望能够在net.TCP基址上获取元数据,则需要在
部分中公开一个net.TCP MEX端点,如下所示:

        <endpoint name="NetTcpMEX"
                  address="netTcpMex"
                  binding="mexTcpBinding"
                  contract="IMetadataExchange" />

请从控制面板->程序->打开或关闭窗口->功能->添加功能->.net framework.*功能->Wcf激活->非Http激活安装“非Http激活”窗口组件

错误(WCF): 找不到与绑定为NetTcpBinding的终结点的scheme net.tcp匹配的基址。注册的基址方案是[http]。

步骤1: 注意WAS(Windows Process Activation Service)或非http协议支持,仅由以下平台支持: •Windows Vista •Windows 7 •Windows Server 2008

  • 转到打开或关闭Windows功能
  • 转到Microsoft.NET Framework 3.5
  • 检查Windows通信基础http激活< /LI>
  • 检查Windows通信基础非HTTP激活< /LI> 步骤2: IIS>WCF主机网站>管理应用程序>高级设置>启用的协议>将值设置为HTTP,NET.TCP

    我遇到了相同的问题(环境:Win7/IIS7.5.NET4),我通过appcmd.exe配置绑定解决了这个问题,该绑定可从目录“c:\Windows\System32\inetsrv”获得

    appcmd.exe设置pp“WebsiteName/applicationName”/enabledProtocols:http,net.tcp

    注意:IIS配置是分层的,因此我们应该在尽可能低的级别更改配置,以避免在其他应用程序上出现不必要的更改/安全问题

    以下链接可能会有所帮助:

    希望这有帮助 Albert

    IIS中“启用的协议”条目中的空格=>选择虚拟目录/应用程序=>高级设置=>启用的协议。e、 g.http,net.tcp。(协议文本之间的空格)

    这应该是http,net.tcp
    (即协议文本之间没有空格)

    ,供将来的读者阅读

    确保您不使用IIS Express

    这是我的“明白了”

    参考:

    这是Visual Studio和web.csproj(或类似)属性以及“web”左侧选项卡下的属性。有一个名为“使用IIS Express”的复选框。取消选中该复选框

    完成此操作后,仍然需要转到IIS(7)和“http,net.tcp”以获取“已启用的协议”(如其他答案中所述)

    此外,如果您得到指定管道特定错误

    找不到与绑定为NetNamedPipeBinding的终结点的scheme net.pipe匹配的基址

    然后需要将“net.pipe”添加到列表中

    例如:

    http,net.tcp,net.pipe

    另请参见下面的指定管道特定错误

    另外:检查这些相应的windows服务(命名管道或tcp或两者)

    (命名管道windows服务)

    (tcp windows服务)


    在经历了大量的解决方案之后..我在这里找到了最终解决方案。但是我将在这里解释整个过程..您需要遵循以下步骤

    步骤1: (Windows Process Activation Service)或非http协议支持,仅受以下平台支持:•Windows Vista•Windows 7•Windows Server 2008

    • 转到打开或关闭Windows功能
    • 去微软。
      net.tcp://localhost:8001/project/filetransfer
      
              <endpoint name="NetTcpMEX"
                        address="netTcpMex"
                        binding="mexTcpBinding"
                        contract="IMetadataExchange" />
      
              Q: Does IIS Express support non-HTTP protocols such as net.tcp or MSMQ?
              A: No. IIS Express only supports HTTP and HTTPS as its protocol.
      
      NetPipeActivator
      
      Net.Pipe Listener Adapter
      
      Receives activation requests over the net.pipe protocol and passes them to the Windows Process Activation Service.
      
      NetTcpActivator
      
      Net.Tcp Listener Adapter
      
      Receives activation requests over the net.tcp protocol and passes them to the Windows Process Activation Service.
      
      %windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='8082:*']
      
      <add baseAddress="net.tcp://localhost:8090" />