wcf - 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;
}
我怎样才能解决这个问题?
解决方案
在网上找了很久,发现问题可能与 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/
如果问题仍然存在,请随时告诉我。
推荐阅读
- python-3.x - Python3如何创建一个返回抵押场景模拟的函数
- javascript - 如何在amcharts地图中的圆圈上设置不同的颜色
- android - Android NDK 2020 C 代码 - 如何启用具有所有优化的发布模式
- html - CSS 媒体查询不适用于任何浏览器
- c# - 当 C++ 代码运行时调用 Thread.Abort 时,如何在 C# 中捕获 ThreadAbortException?
- c# - Blazor 父/子组件未更新
- c++ - 将 int* 传递给 int[][] C/C++
- r - 通过 R 中的 Shiny 在环境中加载和删除数据集
- reactjs - 页面加载时如何使第一个元素 className 处于活动状态?
- python - 如何将pandas数据框中多列的汇总汇总信息作为字符串列表?