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

发布于 2024-11-07 11:05:01 字数 3264 浏览 5 评论 0原文

我在 WCF 代理中调用一个方法,其中绑定是命名管道。目前,代码因异常而失败(与 wmi 有关 - 代码的作用),但是当我随后在同一代理中执行另一个方法时,我收到此错误:

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

显然,这并没有多大帮助。堆栈跟踪是:

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

在 [0] 处重新抛出异常:at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg、IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,Int32 类型)位于 x.xxx.xxxxx(字符串路径,AsyncCallback) 回调,对象状态)位于 x.xproxy.begininstall(字符串路径, AsyncCallback回调,对象状态)中 C:\Users\project\AsyncProxy.cs:第 38 行 xxx.MainForm.begininstall(对象发送者, EventArgs e) 中 C:\Users\project\MainForm.cs:第 647 行 XPrintV7.MainForm.b__e() 中 C:\Users\Gurdip\Desktop\xproject\MainForm.cs:第 664 行 System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry 时间)在 System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(对象 obj) 在 System.Threading.ExecutionContext.runTryCode(Object userData) 处 System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode 代码、CleanupCode backoutCode、对象 userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext、ContextCallback 回调、对象状态)位于 System.Threading.ExecutionContext.Run(ExecutionContext executionContext、ContextCallback 回调、对象状态)位于 System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme) 在 System.Windows.Forms.Control.InvokeMarshaledCallbacks()

可能的原因是什么?

I call a method in a WCF proxy, where the binding is named pipes. At the moment, the code fails with an exception (related to wmi - what the code does), but when I then execute another method in the same proxy, I get this error:

There was an error writing to the pipe: Unrecognized error 232 (0xe8).

Obviously, this doesn't help much. Stacktrace is:

Server stack trace: at
System.ServiceModel.Channels.StreamConnection.BeginWrite(Byte[]
buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout,
AsyncCallback callback, Object state) at
System.ServiceModel.Channels.FramingDuplexSessionChannel.SendAsyncResult.WriteCore()
at
System.ServiceModel.Channels.FramingDuplexSessionChannel.SendAsyncResult..ctor(FramingDuplexSessionChannel
channel, Message message, TimeSpan timeout, AsyncCallback callback,
Object state) at
System.ServiceModel.Channels.FramingDuplexSessionChannel.OnBeginSend(Message
message, TimeSpan timeout, AsyncCallback callback, Object state) at
System.ServiceModel.Channels.OutputChannel.BeginSend(Message message,
TimeSpan timeout, AsyncCallback callback, Object state) at
System.ServiceModel.Dispatcher.DuplexChannelBinder.BeginRequest(Message
message, TimeSpan timeout, AsyncCallback callback, Object state) at
System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartSend(Boolean
completedSynchronously) at
System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureOpen(IAsyncResult
result, Boolean completedSynchronously) at
System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureOpen(Boolean
completedSynchronously) at
System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureInteractiveInit(IAsyncResult
result, Boolean completedSynchronously) at
System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureInteractiveInit()
at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.Begin()
at System.ServiceModel.Channels.ServiceChannel.BeginCall(String
action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins,
TimeSpan timeout, AsyncCallback callback, Object asyncState) at
System.ServiceModel.Channels.ServiceChannel.BeginCall(String action,
Boolean oneway, ProxyOperationRuntime operation, Object[] ins,
AsyncCallback callback, Object asyncState) at
System.ServiceModel.Channels.ServiceChannelProxy.InvokeBeginService(IMethodCallMessage
methodCall, ProxyOperationRuntime operation) at
System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage
message)

Exception rethrown at [0]: at
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
reqMsg, IMessage retMsg) at
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
msgData, Int32 type) at x.xxx.xxxxx(String Path, AsyncCallback
callback, Object state) at x.xproxy.begininstall(String path,
AsyncCallback callback, Object state) in
C:\Users\project\AsyncProxy.cs:line 38 at
xxx.MainForm.begininstall(Object sender, EventArgs e) in
C:\Users\project\MainForm.cs:line 647 at
XPrintV7.MainForm.b__e() in
C:\Users\Gurdip\Desktop\xproject\MainForm.cs:line 664 at
System.Windows.Forms.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry
tme) at
System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)
at System.Threading.ExecutionContext.runTryCode(Object userData) at
System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode
code, CleanupCode backoutCode, Object userData) at
System.Threading.ExecutionContext.RunInternal(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state) at
System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry
tme) at System.Windows.Forms.Control.InvokeMarshaledCallbacks()

What is the probable cause?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

本王不退位尔等都是臣 2024-11-14 11:05:01

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

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

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

The error message tells you that the Win32 error ERROR_NO_DATA occurred when the client-side channel stack tried to send a message to the service over the named pipe. It's difficult to diagnose beyond that with just the info you have provided, but it probably indicates that the client and server ends of the named pipe have got into inconsistent states as a result of the preceding WMI error. Possibly your client-side code is not managing the state of the service proxy instance correctly when the WMI exception happens.

You should enable verbose WCF tracing on both client and service sides, which will provide a clearer picture of what is going on.

Also, posting some of your client code to show where the WMI exception occurs, and how the service proxy is dealt with in the exception handling, may enable someone to answer your question more precisely.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文