我在 c# 中遇到 wcf 的问题。我收到错误消息:“无法获取元数据”。我试图谷歌并在这里检查类似的帖子,但我似乎无法找出问题所在。这是我的 App.config 文件:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="SearchService.PersonServiceBehavior">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="SearchService.PersonServiceBehavior"
name="SearchService.PersonService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="" contract="SearchService.IPersonService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8731/Design_Time_Addresses/SearchService/PersonService/" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
如果有人能找到解决方法或指导我朝着正确的方向前进,我将非常高兴:)