WCF IErrorHandle asynchronous issue

112 Views Asked by At

As far as I know, HandleError is supposed to run asynchronously against service but following code proves that is run on the same thread what service does : both methods display 4 as thread number and what is more HandleError hangs service.

class ErrorHandler : IErrorHandler
{
    public bool HandleError(Exception error)
    {
       Thread.Sleep(55555);
       Debug.WriteLine("Handle : " + Thread.CurrentThread.ManagedThreadId);
       return true;
    }

    public void ProvideFault(Exception error, System.ServiceModel.Channels.MessageVersion version, ref System.ServiceModel.Channels.Message fault)
    {
        Debug.WriteLine("Provice : " + Thread.CurrentThread.ManagedThreadId);
    }
}
0

There are 0 best solutions below