【问题标题】:turn on IncludeExceptionDetailInFaults打开 IncludeExceptionDetailInFaults
【发布时间】:2014-12-03 07:27:37
【问题描述】:

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

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

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

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

请有任何建议。

【问题讨论】:

    标签: c# asmx


    【解决方案1】:
    <configuration>
      <system.serviceModel>
       <behaviors>
        <serviceBehaviors>
          <behavior name="debug">
            <serviceDebug includeExceptionDetailInFaults="true" />
          </behavior>
        </serviceBehaviors>
       </behaviors>
        ...
      </system.serviceModel>
    </configuration>
    

    【讨论】:

    • @Abzakhus 是什么意思?发生错误时是否收到配置异常或未收到异常详细信息?
    • 您的工作站上是否安装了 SDK?为什么不使用 C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SvcConfigEditor.exe?
    猜你喜欢
    • 2012-01-21
    • 1970-01-01
    • 2012-01-09
    • 1970-01-01
    • 2011-05-18
    • 1970-01-01
    • 2011-02-03
    • 2011-01-29
    • 1970-01-01
    相关资源
    最近更新 更多