C# 如何在wcf服务中捕获精确异常

C# 如何在wcf服务中捕获精确异常,c#,wcf,c#-4.0,C#,Wcf,C# 4.0,我想捕捉WCF服务中的所有故障,并找到了实现这一点的方法 OperationContext.Current.Channel.Faulted += delegate(object sender, EventArgs args) { //exception is thrwon in wcf service } 问题是如何知道故障事件中的确切异常情况?更好的方法是通过实现接口来使用

我想捕捉WCF服务中的所有故障,并找到了实现这一点的方法

OperationContext.Current.Channel.Faulted += delegate(object sender, EventArgs args)
{
    //exception is thrwon in wcf service
}

问题是如何知道故障事件中的确切异常情况?

更好的方法是通过实现接口来使用