wcf 不弹出错误提示,只显示“服务器处理请求时遇到错误。有关构造有效服务请求的内容,请参阅服务帮助页”,添加以下节点可以弹出错误提示。
<serviceDebug includeExceptionDetailInFaults="true"/>
<system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <!-- 为避免泄漏元数据信息,请在部署前将以下值设置为 false --> <serviceMetadata httpGetEnabled="true"/> <!-- 要接收故障异常详细信息以进行调试,请将以下值设置为 true。在部署前设置为 false 以避免泄漏异常信息 --> <serviceDebug includeExceptionDetailInFaults="true"/> </behavior> </serviceBehaviors> </behaviors> <protocolMapping> <add binding="basicHttpsBinding" scheme="https"/> </protocolMapping> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
原文:https://www.cnblogs.com/guohu/p/11136053.html