有两种方式:
1)配置文件中配置:在服务端的配置文件behaviors节下配置serviceDebug的属性includeExceptionDetailInFaults=True即可
<behaviors>
<serviceBehaviors>
<behavior name="serviceBehavior">
<serviceDebug includeExceptionDetailInFaults="True"/>
</behavior>
</serviceBehaviors>
</behaviors>
2)使用服务行为属性来设置:在服务端使用ServiceBehaviorAttribute来初始化
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
public class MediaManagerService: IMediaManagerService, IMediaStreaming