Logging exceptions in WCF with IErrorHandler inside HandleError or ProvideFault?
问题 I'm using IErrorHandler to do exception handling in WCF and now I want to log the exceptions, along with the stack trace and the user that caused the exception. The only way I can see to get the user that caused the exception is: OperationContext.Current.IncomingMessageProperties.Security.ServiceSecurityContext.PrimaryIdentity ...But this only seems to work inside ProvideFault, and not inside HandleError. Is there a way to get the user inside HandleError? I would like to use HandleError