2015-08-21 28 views
0

錯誤顯示:在服務'HelloService'實現的合同列表中找不到合同名'IMetaDataExchange'。在服務'HelloService'實施的合同列表中找不到IMcfDataExchange'

我的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> 

回答

0

這個問題可能是你寫的標籤(IMetadataExchange接口)套管:

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

必須是:

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

希望它可以幫助

+0

感謝這麼多,它正在... – chandraj

+0

很大。請不要忘記在我的答案中投票 –