Wcf 写入管道时出错:无法识别的错误232(0xe8)

Wcf 写入管道时出错:无法识别的错误232(0xe8),wcf,named-pipes,Wcf,Named Pipes,我在WCF代理中调用一个方法,其中绑定名为pipes。目前,代码失败并出现异常(与wmi相关-代码的功能),但当我在同一代理中执行另一个方法时,我会出现以下错误: 写入管道时出错:无法识别的错误232(0xe8) 显然,这没有多大帮助。Stacktrace是: 服务器堆栈跟踪:在 System.ServiceModel.Channel.StreamConnection.BeginWrite(字节[]) 缓冲区、Int32偏移量、Int32大小、布尔立即数、TimeSpan超时、, 异步回调,对象

我在WCF代理中调用一个方法,其中绑定名为pipes。目前,代码失败并出现异常(与wmi相关-代码的功能),但当我在同一代理中执行另一个方法时,我会出现以下错误:

写入管道时出错:无法识别的错误232(0xe8)

显然,这没有多大帮助。Stacktrace是:

服务器堆栈跟踪:在 System.ServiceModel.Channel.StreamConnection.BeginWrite(字节[]) 缓冲区、Int32偏移量、Int32大小、布尔立即数、TimeSpan超时、, 异步回调,对象状态)在 System.ServiceModel.Channels.FramingDuplexSessionChannel.SendAsyncResult.WriteCore() 在 System.ServiceModel.Channel.FramingDuplexSessionChannel.SendAsyncResult..ctor(FramingDuplexSessionChannel 通道、消息消息、TimeSpan超时、异步回调、, 对象状态)在 System.ServiceModel.Channel.FramingDuplexSessionChannel.OnBeginSend(消息 消息、TimeSpan超时、异步回调、对象状态) System.ServiceModel.Channels.OutputChannel.BeginSend(消息, TimeSpan超时,异步回调,对象状态) System.ServiceModel.Dispatcher.DuplexChannelBinder.BeginRequest(消息 消息、TimeSpan超时、异步回调、对象状态) System.ServiceModel.Channel.ServiceChannel.SendAsyncResult.StartSend(布尔值 同步完成)在 System.ServiceModel.Channel.ServiceChannel.SendAsyncResult.FinishSureOpen(IAsyncResult 结果,布尔值同步完成)在 System.ServiceModel.Channel.ServiceChannel.SendAsyncResult.StartEnsureOpen(布尔值 同步完成)在 System.ServiceModel.Channel.ServiceChannel.SendAsyncResult.FinishSureInteractiveInit(IAsyncResult 结果,布尔值同步完成)在 System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureInteractiveInit() 位于System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()处 位于System.ServiceModel.Channels.ServiceChannel.BeginCall(字符串 操作,布尔单向,ProxyOperationRuntime操作,对象[]ins, TimeSpan超时,异步回调,对象异步状态) System.ServiceModel.Channel.ServiceChannel.BeginCall(字符串操作, 布尔单向,ProxyOperationRuntime操作,对象[]ins, 异步回调,对象异步状态)位于 System.ServiceModel.Channels.ServiceChannelProxy.InvokeBeginService(IMethodCallMessage 方法调用,ProxyOperationRuntime操作)在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage (信息)

在[0]处重试异常:在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32类型),位于x.xxx.xxxxx(字符串路径,异步回调) 在x.xproxy.begininstall(字符串路径, 中的异步回调(对象状态) C:\Users\project\AsyncProxy.cs:第38行 中的xxx.MainForm.begininstall(对象发送方、事件参数) C:\Users\project\MainForm.cs:647行 中的XPrintV7.MainForm.b_;e() C:\Users\Gurdip\Desktop\xproject\MainForm.cs:第664行 System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme)在 System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(对象obj) 位于System.Threading.ExecutionContext.runTryCode(对象用户数据) System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode 代码,清除代码backoutCode,对象userData)位于 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext、ContextCallback回调、对象状态)位于 System.Threading.ExecutionContext.Run(ExecutionContext executionContext、ContextCallback回调、对象状态)位于 System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry 在System.Windows.Forms.Control.InvokeMarshaledCallbacks()中


可能的原因是什么?

错误消息告诉您,当客户端通道堆栈试图通过命名管道向服务发送消息时,发生Win32错误
error\u NO\u DATA
。仅凭您提供的信息很难进行诊断,但这可能表明由于前面的WMI错误,命名管道的客户端和服务器端已进入不一致的状态。当WMI异常发生时,客户端代码可能无法正确管理服务代理实例的状态

您应该在客户端和服务端启用详细的WCF跟踪,这将更清楚地了解正在发生的事情


此外,发布一些客户端代码以显示WMI异常发生的位置,以及在异常处理中如何处理服务代理,可能会使其他人更准确地回答您的问题。

谢谢,我将尝试这样做。但是我传递给wcf服务的只是一个字符串(即一个文件路径)、一个回调方法委托和一个状态对象(为此我传递了一个空字符串),这很难把船推出去?