首页 > 解决方案 > WCF 从管道读取错误:管道已结束。(109, 0x6d)

问题描述

我在实时服务器和性能问题上不断出现异常。

在 wcf 配置文件中启用跟踪服务日志后,我发现了 100 个相同的异常。

在此处输入图像描述

基本信息

 Activity ID    {00000000-0000-0000-0000-000000000000}
Time    2019-08-26 19:59:44.7454
Level   Error
Source  System.ServiceModel
Process w3wp
Thread  55
Computer    PC3
Trace Identifier/Code   https://docs.microsoft.com/dotnet/framework/wcf/diagnostics/tracing/System-ServiceModel-Diagnostics-ThrowingException

例外

System.IO.PipeException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

异常类型

System.IO.PipeException, System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

信息

There was an error reading from the pipe: The pipe has been ended. (109, 0x6d).

这是我正在使用的代码

public static WMC.Proxy.BLLService.BLLServiceClient GetBLLServiceClient()
        {
            var client = new WMC.Proxy.BLLService.BLLServiceClient(settings.GetBinding(settings.BLLServiceBinding), new EndpointAddress(settings.BLLServiceAddress));
            SetMaxGraphInItems(client);
            return client;
        }

我怎样才能解决这个问题?

标签: wcfexceptionwcf-bindingsvctraceviewer

解决方案


在网上找了很久,发现问题可能与 Enum 类型有关,导致序列化失败。
https://social.msdn.microsoft.com/Forums/vstudio/en-US/ee75d768-fd80-4c2b-831e-1d6dd6d4dd17/there-was-an-error-reading-from-the-pipe-the-pipe- has-been-ended-109-0x6d?forum=wcf
WCF NamedPipe CommunicationException - “管道已结束。(109, 0x6d)。”
造成这个问题的因素很多,包括数据合同、服务合同的不规范。归结为序列化存在问题的事实。请参考下面的讨论,希望对您有用。
http://gonetdotnet.blogspot.com/2014/07/solved-there-was-error-reading-from.html
https://blogs.infosupport.com/there-was-an-error-reading-from-the-pipe-unrecognized-error/
如果问题仍然存在,请随时告诉我。


推荐阅读