自定义WCF服务-includeExceptionDetailInFaults
-
09-12-2019 - |
题
我有一个自定义WCF服务,我使用CKS toolkit For SharePoint创建。
如何启用 includeExceptionDetailInFaults
在这些服务?
我理解的方式是,当使用 BasicHttpBindingServiceMetadataExchangeEndpoint
SharePoint动态创建端点?
那么我在哪里启用了异常?
Thx
更新资料
我可以用 [ServiceBehavior(IncludeExceptionDetailInFaults = true)]
哪个工作,但最好在配置中有这个??
解决方案
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
**<serviceDebug includeExceptionDetailInFaults="true" />**
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>