gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 01:45:40 24 4
gpt4 key购买 nike

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

也许有人可以看看并发现一个我看不到的明显错误。

我有一个 Windows 服务,托管两个契约(Contract):

  • IConfigurationService
  • IConfigurationAdminService

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

    问题是我可以很好地托管服务,直到我尝试添加 MEX。

    然后我得到以下异常:

    The contract name 'IMetaDataExchange' could not be found in the list of contracts implemented by the service 'ConfigurationWCFService'.



    这是我的配置,一切都由配置配置,没有通过代码完成。
    <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" />

    请注意, IMetadataExchange 中的“D”没有大写您可以仔细检查 syntax on MSDN .

    关于.net - 在服务实现的合约列表中找不到 IMetaDataExchange,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3871827/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com