wcf tcp.net“找不到基地址”消息

时间:2017-04-18 06:42:26

标签: visual-studio wcf

我收到错误: 无法找到与绑定NetTcpBinding的端点匹配scheme net.tcp的基址。注册的基地址方案是[http]。

我已阅读此错误的回复但仍然没有。任何帮助将不胜感激。

这是我的Web.config:

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

  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" targetFramework="4.5.2" />
    <httpRuntime targetFramework="4.5.2"/>
	<customErrors mode="Off" />
  </system.web>
  
  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
    <!--
        To browse web app root directory during debugging, set the value below to true.
        Set to false before deployment to avoid disclosing web app folder information.
      -->
    <directoryBrowse enabled="true"/>
  </system.webServer>
  
<system.serviceModel>
    <services>
      <service behaviorConfiguration="WcfNetTcpLogService.Service1Behavior"
        name="WcfNetTcpLogService.InsertRecord">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration=""
          contract="WcfNetTcpLogService.IInsertRecord">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:8090/InsertRecord" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WcfNetTcpLogService.Service1Behavior">
          <serviceMetadata httpGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>

此Web.config几乎完全匹配Microsoft网站上的示例:https://msdn.microsoft.com/en-au/library/ff649818.aspx。端口号码不同,但我已经迎合8090和8523。

我正在使用Visual Studio Enterprise 2015在Windows Server 2008 R2 Enterprise Service Pack 1上构建服务并运行IIS 7.5。 绑定http :*:980:,net.pipe:*,net.tcp:8090:*,net.tcp:8523:* 启用协议:http,net.tcp 服务:Net.TCP侦听器适配器正在运行 Windows功能:WCF激活,HTTP激活,非HTTP激活 .NET Framework 4.5.2

我的代码已成功构建,但当我单击“开始”时,Microsoft WCF测试客户端会说: 无法找到与绑定NetTcpBinding的端点匹配scheme net.tcp的基址。注册的基地址方案是[http]。

0 个答案:

没有答案