草庐IT

IncludeExceptionDetailInFaults

全部标签

c# - 在服务器上打开 IncludeExceptionDetailInFaults(来自 ServiceBehaviorAttribute 或 <serviceDebug> 配置行为)

我有一个运行良好的WCF服务,但我不知道发生了什么变化。我得到这个异常:System.ServiceModel.FaultException:Theserverwasunabletoprocesstherequestduetoaninternalerror.Formoreinformationabouttheerror,eitherturnonIncludeExceptionDetailInFaults(eitherfromServiceBehaviorAttributeorfromtheconfigurationbehavior)ontheserverinordertosendthe

c# - 在服务器上打开 IncludeExceptionDetailInFaults(来自 ServiceBehaviorAttribute 或 <serviceDebug> 配置行为)

我有一个运行良好的WCF服务,但我不知道发生了什么变化。我得到这个异常:System.ServiceModel.FaultException:Theserverwasunabletoprocesstherequestduetoaninternalerror.Formoreinformationabouttheerror,eitherturnonIncludeExceptionDetailInFaults(eitherfromServiceBehaviorAttributeorfromtheconfigurationbehavior)ontheserverinordertosendthe

c# - 在 WCF 的代码中将 IncludeExceptionDetailInFaults 设置为 true

如何在不使用App.Config的情况下在代码中设置IncludeExceptionDetailInFaults? 最佳答案 是的,当然-在服务器端,在您打开服务主机之前。但是,这需要您自行托管WCF服务-在IIS托管方案中不起作用:ServiceHosthost=newServiceHost(typeof(MyWCFService));ServiceDebugBehaviordebug=host.Description.Behaviors.Find();//ifnotfound-addbehaviorwithsettingturn