用戶端收到通用「The server was unable to process the request due to an internal error」,因服務端未回傳例外細節。立即在服務類別加入:
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class WCFService : IWCFService { ... }
或設定檔:
<serviceDebug includeExceptionDetailInFaults="true" />
重新呼叫即可獲得完整例外堆疊,快速定位根因。**生產環境請關閉,避免洩漏敏感資訊。**