我在VS2012中运行的WCF服务:无法从localhost获取元数据

时间:2015-02-25 13:51:08

标签: .net wcf visual-studio-2012 metadata config

我知道这个错误已在这里发布了很多,我已经阅读了无数的帖子试图找到答案,经过几个小时的工作后我仍然被困住了。昨天早上,我的服务工作得很好,但到了最后它开始显示这个错误。我没有更改我的app.config,但正在进行代码更改。我假设我的代码中的某些内容发生了变化,但是我无法弄清楚是什么。我查看了我的事件日志,但没有任何内容引用我的服务。

虽然我不相信我的配置有任何问题,但这是它的内容:

<system.serviceModel>
<services>
  <service name="ElectronicContactServiceLibrary.ElectronicContactService">
    <endpoint address="" binding="basicHttpBinding" contract="ElectronicContactServiceLibrary.IElectronicContactService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8733/Design_Time_Addresses/ElectronicContactServiceLibrary/ElectronicContactService/" />
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior>
      <!-- To avoid disclosing metadata information, 
      set the values below to false before deployment -->
      <serviceMetadata httpGetEnabled="True" httpsGetEnabled="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="True" />
    </behavior>
  </serviceBehaviors>
</behaviors>

我可以采取哪些措施来解决问题?

1 个答案:

答案 0 :(得分:0)

我似乎添加了一个枚举值不正确的装饰,因为我忘记填充值:

<DataContract>
Public Enum Status
    <EnumMember(Value:="")>
    NoValue = 0
相关问题