WCF读取管道时出错:管道已结束。(109,0x6d)
我在实时服务器和性能问题上持续出现异常 在wcf配置文件中启用跟踪服务日志后,我发现了100个相同的异常 基本信息WCF读取管道时出错:管道已结束。(109,0x6d),wcf,exception,wcf-binding,svctraceviewer,Wcf,Exception,Wcf Binding,Svctraceviewer,我在实时服务器和性能问题上持续出现异常 在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
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
例外情况
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).
消息
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;
}
如何解决此问题?在internet上进行长时间搜索后,我发现问题可能与枚举类型有关,这导致序列化失败。
造成这个问题的因素很多,包括数据合同、服务合同违规。归根结底,这是因为序列化有问题。请参考下面的讨论,希望对您有用。
如果问题仍然存在,请随时通知我。为了确定,这里是跟踪侦听器的web.config部分:
<system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing"><listeners><add name="xml" /></listeners></source>
<source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true"><listeners><add name="xml" /></listeners></source>
<source name="CardSpace"><listeners><add name="xml" /></listeners></source>
<source name="System.IO.Log"><listeners><add name="xml" /></listeners></source>
<source name="System.Runtime.Serialization"><listeners><add name="xml" /></listeners></source>
<source name="System.IdentityModel"><listeners><add name="xml" /></listeners></source>
</sources>
<sharedListeners>
<add name="xml" type="System.Diagnostics.XmlWriterTraceListener" initializeData="D:\PutYourPathHere.svclog" />
</sharedListeners>
</system.diagnostics>
可以使用Microsoft Service Trace Viewer检查生成的文件
试着检查其他事件。可能有一些与合同相关的问题导致序列化失败
如果您完全确定契约和序列化是正常的,那么请尝试重新启动“Net.Pipe侦听器适配器”服务
如果这没有帮助,请尝试回收应用程序池
在新版本或配置更新之后,我们可以不时看到这些问题。它们与先前实例的错误通信终止有关