2

我正在尝试使用 netTcpBinding 使用 WCF 测试客户端运行我的服务(使用 basicHTTP 服务运行良好)。我收到以下错误

错误:无法从 net.tcp://chatmesh/mex 获取元数据 如果这是您有权访问的 Windows (R) Communication Foundation 服务,请检查您是否已在指定地址启用元数据发布。有关启用元数据发布的帮助,请参阅位于http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error URI: net.tcp://chatmesh/mex Metadata contains a reference的 MSDN 文档无法解决:'net.tcp://chatmesh/mex'。主机聊天网格不存在 DNS 条目。没有这样的主机是已知的

我没有看到任何会导致问题的明显错误。下面是我的 app.config。有人对我有什么建议吗?

<?xml version="1.0" encoding="utf-8" ?>

<!--SERVICE App.config file-->
<configuration>

  <appSettings>
    <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  </appSettings>
  <system.web>
    <compilation debug="true" />
  </system.web> 
  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="NewBinding0">
          <security mode="None" />
        </binding>
      </netTcpBinding>
    </bindings>
    <services>
      <service name="MachineLibrary.Machine1">
        <endpoint address="" binding="netTcpBinding" bindingConfiguration="NewBinding0"
          name="" contract="MachineLibrary.IMachine1">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://Chatmesh" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

</configuration>
4

0 回答 0