turn on IncludeExceptionDetailInFaults

点点圈 提交于 2019-12-24 08:47:25

问题


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

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.

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>

any suggestion PLEASE.


回答1:


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


来源:https://stackoverflow.com/questions/26260245/turn-on-includeexceptiondetailinfaults

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!