Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在WCF服务中引发异常会引发CommunicationException_Wcf_Communicationexception - Fatal编程技术网

在WCF服务中引发异常会引发CommunicationException

在WCF服务中引发异常会引发CommunicationException,wcf,communicationexception,Wcf,Communicationexception,每当我在服务中引发异常时,紧接着会引发另一个异常: System.ServiceModel.CommunicationException: There was an error reading from the pipe: Unrecognized error 109 (0x6d). ---> System.IO.PipeException: There was an error reading from the pipe: Unrecognized error 109 (0x6d).

每当我在服务中引发异常时,紧接着会引发另一个异常:

System.ServiceModel.CommunicationException: There was an error reading from the
pipe: Unrecognized error 109 (0x6d). ---> System.IO.PipeException: There was an
error reading from the pipe: Unrecognized error 109 (0x6d).
我正在实现IErrorHandler,以便能够记录(使用log4net)所有未处理的异常:

    bool IErrorHandler.HandleError(Exception error)
    {
        if (!(error is FaultException))
        {
            logger.Fatal("Unhandled Exception", error);
        }
        return false;
    }

知道为什么吗?

问题是,每当我返回错误异常时,客户端都会在通道上调用Abort。

我会再次检查问题是否真的存在于处理程序中。我做了完全相同的事情。我想说的是,IErrorHandler通常是一种有效的方法。为了解决这个问题,您做了哪些更改?是否删除中止调用?用其他东西替换它(Close)?事实上,客户机必须调用Close(或其等价物,取决于平台)@MeidanAlon:这是如何工作的?无法对处于故障状态的通道调用Close,因为它会引发不同的异常-“通信对象System.ServiceModel.Channels.ServiceChannel无法用于通信,因为它处于故障状态。”