1
在托管我在IIS上称为“SimpleWCF”的WCF服务;我在浏览器中手动浏览时遇到以下错误;
元数据错误 - WCF
无法在由服务SimpleWCF实施的合同列表中找到合同名称'IMetadataExchange'。将ServiceMetadataBehavior添加到配置文件或直接添加到ServiceHost以启用对此合同的支持。
我无法理解这个错误的原因[仍然是新的。
这是我的配置文件;
<configuration>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="LargeData" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
<security mode="None">
</security>
</binding>
</basicHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service name="SimpleWCF">
<endpoint address="http://localhost/Sample/SimpleWCF.svc" binding="basicHttpBinding" bindingConfiguration="LargeData" contract="SimpleWCF"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
(+1)你是男人的标志。我有同样的问题,直到我一起删除名称属性。 – capdragon 2011-09-09 17:44:44