WCF netTcpBinding - 无法访问元数据

时间:2013-06-24 19:28:41

标签: c# wcf wcf-binding

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

  

错误:无法从net.tcp获取元数据:// chatmesh / mex如果这是您有权访问的Windows(R)Communication Foundation服务,请检查您是否已在指定地址启用了元数据发布。有关启用元数据发布的帮助,请参阅http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata上的MSDN文档.Exchange错误URI:net.tcp:// chatmesh / mex元数据包含无法解析的引用:'net.tcp:// chatmesh / mex ”。主机chatmesh不存在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>

0 个答案:

没有答案