【问题标题】:In wcf IMetaDataExchange' could not be found in the list of contracts implemented by the service 'HelloService'在 wcf IMetaDataExchange 中,在服务“HelloService”实施的合同列表中找不到
【发布时间】:2015-08-21 18:45:29
【问题描述】:

错误显示:在服务“HelloService”实施的合同列表中找不到合同名称“IMetaDataExchange”。

我的 App.config 如下所示。为什么会这样,请指导我。

<services>
  <service name="HelloService.HelloService" behaviorConfiguration="defaultBehavior">
    <endpoint address="HelloService" binding="basicHttpBinding" contract="HelloService.IHelloService"></endpoint>
    <endpoint address="HelloService" binding="netTcpBinding" contract="HelloService.IHelloService"></endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetaDataExchange"></endpoint>
    <!--<endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="mexBinding" contract="System.ServiceModel.Description.IMetadataExchange" />-->
    <host>
      <baseAddresses>
        <add baseAddress="http://10.135.32.65:8080/"/>
        <add baseAddress="net.tcp://localhost:8090/"/>
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>

  <serviceBehaviors>
    <behavior name="defaultBehavior">
      <serviceDebug includeExceptionDetailInFaults="true" />
      <serviceMetadata httpGetEnabled="true" />
    </behavior>
  </serviceBehaviors>
</behaviors>

【问题讨论】:

    标签: wcf hosting


    【解决方案1】:

    问题可能是你写标签的大小写(IMetadataExchange):

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetaDataExchange"></endpoint>
    

    必须是:

    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"></endpoint>
    

    希望对你有帮助

    【讨论】:

      猜你喜欢
      • 2012-02-17
      • 1970-01-01
      • 1970-01-01
      • 2020-05-26
      • 1970-01-01
      • 2014-11-09
      • 1970-01-01
      • 2011-12-01
      • 1970-01-01
      相关资源
      最近更新 更多