我有一个基本的 wcf 服务,当我去 wcfctestclient 测试它时,我收到一条错误消息,说找不到元数据,请添加它等等。不幸的是,错误弹出窗口中的 MSDN 链接已损坏,我的 WCF 服务的app.config 启用了元数据:
<serviceBehaviors>
<behavior name="TelerikWcfServices.Service1Behavior">
<!-- To avoid disclosing metadata information,
set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="True"/>
<!-- To receive exception details in faults for debugging purposes,
set the value below to true. Set to false before deployment
to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
除此之外,我没有更改代码中其他任何地方的任何元数据设置。
我在哪里可以启用元数据来修复错误?
最佳答案
您需要将元数据交换 (MEX) 端点添加到您的服务节点。尝试这样的事情:
<endpoint
address="http://host/svc/mex"
binding="mexHttpBinding"
bindingConfiguration=""
contract="IMetadataExchange"/>
关于.net - 在哪里启用元数据(在配置中启用)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1546716/