打开IncludeExceptionDetailInFaults [英] turn on IncludeExceptionDetailInFaults

查看:63
本文介绍了打开IncludeExceptionDetailInFaults的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用在某些情况下可以工作并出现异常的asmx Web服务:

I am using asmx webservice that work in some cases and getting exception :

System.ServiceModel.FaultException:由于内部错误,服务器无法处理请求.有关错误的更多信息,请打开服务器上的IncludeExceptionDetailInFaults(从ServiceBehaviorAttribute或从配置行为)以将异常信息发送回客户端,或者根据Microsoft .NET Framework 3.0 SDK文档打开跟踪.并检查服务器跟踪日志.

System.ServiceModel.FaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace logs.

我必须尝试通过将其添加到web.config来打开IncludeExceptionDetailInFaults,但是我的孩子无效:

I have to try to turn on IncludeExceptionDetailInFaults by adding this to web.config but I got invalid child :

 <configuration>
<system.serviceModel>
<serviceBehaviors>
  <behavior name="debug">
    <serviceDebug includeExceptionDetailInFaults="true" />
  </behavior>
</serviceBehaviors>
... 
</system.serviceModel>
</configuration>

请提出任何建议.

推荐答案

<configuration>
  <system.serviceModel>
   <behaviors>
    <serviceBehaviors>
      <behavior name="debug">
        <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
    </serviceBehaviors>
   </behaviors>
    ...
  </system.serviceModel>
</configuration>

这篇关于打开IncludeExceptionDetailInFaults的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆