在客户端测试中测试wcf时出错

时间:2014-10-28 10:50:02

标签: c# wcf

我正在创建一个简单的wcf Web服务,允许用户从数据库表中提取数据。实施后如果我在网络浏览器中查看服务,我会得到页面后面的页面

After viewing the service in browser i got the page without error      (您已创建了一项服务。)没有任何错误。但如果我调试模式,我会得到以下错误。

displayed this page if debugging to run in test client window

我真的不明白问题的来源,但我认为它来自我的配置很好,但我不能得到的地方。

这是我的web.config文件。

<system.serviceModel>
    <services>
        <service behaviorConfiguration="namespaceName.Service1Behavior" name="namespaceName.Service">
            <endpoint address="http://localhost:6937/Service.svc" binding="basicHttpBinding" contract="namespaceName.IService">
                <identity>
                    <dns value="localhost" />
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="namespaceName.Service1Behavior">
                <!-- To avoid disclosing metadata information, set the value below to false 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>
    </behaviors>
</system.serviceModel>

1 个答案:

答案 0 :(得分:1)

我认为你在配置文件中有这个:

<system.web>
  <compilation debug="true" />
<system.web>