WCF 从管道读取错误:管道已结束。 (109, 0x6d)
WCF There was an error reading from the pipe: The pipe has been ended. (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 - "The pipe has been ended. (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/
如果问题仍然存在,请随时告诉我。
为了确定,这里是跟踪侦听器的 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 Listener Adapter" 服务。
如果这没有帮助,请尝试回收应用程序池。
我们可以在新版本或配置更新后不时看到这些问题。它们与之前实例的错误通信终止有关。
我在实时服务器和性能问题上一直遇到异常。
在 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 - "The pipe has been ended. (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/
如果问题仍然存在,请随时告诉我。
为了确定,这里是跟踪侦听器的 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 Listener Adapter" 服务。
如果这没有帮助,请尝试回收应用程序池。
我们可以在新版本或配置更新后不时看到这些问题。它们与之前实例的错误通信终止有关。