首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式碼之家 >> 編程語言 >  >> .NET 網頁程式設計 >> 關於.NET

WCF 分散式開發常見錯誤 (12):Server Unable to Process Request —— 開啟 IncludeExceptionDetailInFaults 取得真實錯誤

     編輯:關於.NET

用戶端收到通用「The server was unable to process the request due to an internal error」,因服務端未回傳例外細節。立即在服務類別加入:

[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class WCFService : IWCFService { ... }

或設定檔:

<serviceDebug includeExceptionDetailInFaults="true" />

重新呼叫即可獲得完整例外堆疊,快速定位根因。**生產環境請關閉,避免洩漏敏感資訊。**

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式碼之家 All Rights Reserved