gpt4 book ai didi

c# - 找不到与方案 net.tcp 匹配的基址

转载 作者:IT王子 更新时间:2023-10-29 04:10:02 28 4
gpt4 key购买 nike

我已将文件传输服务从 basicHttpBinding 移至 netTcpBinding因为我正在尝试设置双工模式 channel 。我也开始了我的 net.tcp端口共享服务。

我目前在开发中,在我们移动应用程序到开发服务器。所以,目前,我无法访问 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>

而且,我的绑定(bind)是这样的:

<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 文件时出现以下错误:

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

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

有什么想法吗?


更新:我以为我已经开始工作了,但它仍然没有工作。这是我现在拥有的:我仍然收到“找不到与方案 net.tcp 匹配的基址”错误。我已经更改了所有基地址以反射(reflect)您的建议。这是我现在拥有的:

<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>

我已经尝试过使用“net.tcp://localhost:2544”和“net.tcp://localhost:8001”。我是否需要在我的防火墙设置中添加(允许)某些内容?还有其他建议吗?

这是我的 App.config 文件中我的文件传输服务的 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>

我仍然无法在我的网络应用程序中引用我的 FileTransferServiceClient。

再次感谢。

最佳答案

错误(WCF):找不到与具有绑定(bind) NetTcpBinding 的端点的方案 net.tcp 相匹配的基地址。注册的基地址方案是 [http]。

第 1 步:注意 WAS(Windows Process Activation Service)或非 http 协议(protocol)支持,仅受以下平台支持:• Windows Vista• Windows 7的• Windows 服务器 2008

  1. 转到打开或关闭 Windows 功能
  2. 转到 Microsoft .NET Framework 3.5
  3. 检查 Windows Communication Foundation HTTP 激活
  4. 检查 Windows Communication Foundation 非 HTTP 激活

第 2 步:IIS > WCF Host Web Site > Manage Application > advanced Settings > Enabled Protocols > 将值设置为 HTTP,NET.TCP

关于c# - 找不到与方案 net.tcp 匹配的基址,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1793119/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com