Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 在服务实现的合约列表中找不到IMetaDataExchange_.net_Wcf_Exception Handling_Metadata_Wcf Configuration - Fatal编程技术网

.net 在服务实现的合约列表中找不到IMetaDataExchange

.net 在服务实现的合约列表中找不到IMetaDataExchange,.net,wcf,exception-handling,metadata,wcf-configuration,.net,Wcf,Exception Handling,Metadata,Wcf Configuration,我在网上搜索了这个错误的解决方案,但我发现的一切都表明我所说的是正确的 也许有人可以看看,发现一个明显的错误,我只是看不见 我有一个windows服务,托管两个合同: IConfigurationService IConfigurationAdminService 管理服务继承自标准服务,因为我希望两个契约都实现基本方法 问题是,在我尝试添加MEX之前,我可以很好地托管服务 然后我得到以下异常: 在由服务“ConfigurationWCFService”实现的合约列表中找不到合约名称“IMead

我在网上搜索了这个错误的解决方案,但我发现的一切都表明我所说的是正确的

也许有人可以看看,发现一个明显的错误,我只是看不见

我有一个windows服务,托管两个合同:

  • IConfigurationService
  • IConfigurationAdminService
  • 管理服务继承自标准服务,因为我希望两个契约都实现基本方法

    问题是,在我尝试添加MEX之前,我可以很好地托管服务

    然后我得到以下异常:

    在由服务“ConfigurationWCFService”实现的合约列表中找不到合约名称“IMeadataExchange”

    这是我的配置,一切都是通过配置来配置的,没有通过代码来完成

    <system.serviceModel>
        <bindings>
          <netTcpBinding>
            <binding name="tcpBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
              <readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647" />
              <security mode="None" />
            </binding>
          </netTcpBinding>
        </bindings>
        <services>
          <service behaviorConfiguration="serviceBehavior" name="BrightsideGroup.Repa.Configuration.ConfigurationWCFService">
            <endpoint address="ConfigurationService" binding="netTcpBinding"
              bindingConfiguration="tcpBinding" name="tcpConfiguration" contract="BrightsideGroup.Repa.Configuration.IConfigurationWCFService" />
            <endpoint binding="mexHttpBinding" address="mex" name="mex" contract="IMetaDataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://GD01316:9123/Repa" />
                <add baseAddress="http://GD01316:8123/Repa" />
              </baseAddresses>
            </host>
          </service>
          <service behaviorConfiguration="serviceBehavior" name="BrightsideGroup.Repa.Configuration.ConfigurationWCFAdminService">
            <endpoint address="ConfigurationAdminService" binding="netTcpBinding"
              bindingConfiguration="tcpBinding" name="tcpConfigurationAdmin"
              contract="BrightsideGroup.Repa.Configuration.IConfigurationAdminWCFService" />
            <endpoint binding="mexHttpBinding" address="mex" name="mex" contract="IMetaDataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="net.tcp://GD01316:9124/Repa" />
                <add baseAddress="http://GD01316:8124/Repa" />
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="serviceBehavior">
              <serviceMetadata httpGetEnabled="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    

    您的外壳不正确-WCF配置区分大小写

     <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" />
    
    
    
    请注意,
    imeadataexchange
    中的“D”不是大写的,您可以再次检查

    我希望他们能为你提供帮助

    并尝试添加以下内容:

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

    我正在为所有人使用NetTcpBinding。在我的案例中,我遇到了同样的问题,并通过添加以下内容来解决:

    (a) 连接到mex端点的行为配置“”

    <endpoint address="mex" 
              binding="mexTcpBinding" 
              contract="IMetadataExchange" 
              behaviourConfiguration="" />
    
    
    
    (b) 服务定义的行为配置=“mex”:

    <services>
        <service name="AcmeService" behaviourConfiguration="mex">
    
    
    
    (c) 行为条目

    <behaviors>
        <serviceBehaviors>
            <behaviour name="mex">
                <serviceDebug includeExceptionDetailInFaults="false"/>
                <serviceMetadata />
            </behavior>
         </serviceBehaviors>
     </behaviors>
    
    
    
    谢谢。我知道它必须是简单的!!看不见森林的树木!!谢谢。标记下来,因为问题已经得到了回答,这不起作用,因为它是错误的协议,我使用的是http,而不是net.tcp。因为我在基址中看到了net.tcp的条目,我认为您也在使用它。而且,当我回答这个问题时,我没有意识到还有另一个答案。非常感谢。