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

C# 在客户端测试中测试wcf时出错,c#,wcf,C#,Wcf,我正在创建一个简单的wcf web服务,允许用户从数据库表中提取数据。在实现之后,如果我在web浏览器中查看服务,我将获得下一页 (您已经创建了一个服务。)没有任何错误。但是如果我调试模式,我会得到以下错误 我真的不明白这个问题是从哪里来的,但我想它是从我的配置来的,很好,但我就是不明白 这是我的web.config文件 <system.serviceModel> <services> <service behaviorConfigura

我正在创建一个简单的wcf web服务,允许用户从数据库表中提取数据。在实现之后,如果我在web浏览器中查看服务,我将获得下一页

(您已经创建了一个服务。)没有任何错误。但是如果我调试模式,我会得到以下错误

我真的不明白这个问题是从哪里来的,但我想它是从我的配置来的,很好,但我就是不明白

这是我的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>

我想您的配置文件中有:

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

谢谢@krystan,我没有包括这个。但现在我已经添加了它。再次感谢。