我在WCF代理中调用一个方法,其中绑定被命名为管道.目前,代码失败并出现异常(与wmi相关 - 代码的作用),但是当我在同一代理中执行另一个方法时,我收到此错误:
写入管道时出错:无法识别错误232(0xe8).
显然,这没有多大帮助.Stacktrace是:
服务器堆栈跟踪:位于System.ServiceModels.Cream.Berings.FramingDuplexSessionChannel.SendAsyncResult.WriteCore的System.ServiceModel.Channels.StreamConnection.BeginWrite(Byte []缓冲区,Int32偏移量,Int32大小,布尔值立即数,TimeSpan超时,AsyncCallback回调,对象状态) ()System.ServiceModel.CramingDuplexSessionChannel.SendAsyncResult..ctor(FramingDuplexSessionChannel频道,消息消息,TimeSpan超时,AsyncCallback回调,对象状态)在System.ServiceModel.Channels.FramingDuplexSessionChannel.OnBeginSend(消息消息,TimeSpan超时,AsyncCallback回调) ,对象状态)System.ServiceModel.Channels.OutputChannel.BeginSend(消息消息,TimeSpan超时,AsyncCallback回调,对象状态)在System.ServiceModel.Dispatcher.DuplexChannelBinder.BeginRequest(消息消息,TimeSpan超时,AsyncCallback回调,对象状态) Sy的System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartSend(Boolean completedSynchronously)stem.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureOpen(IAsyncResult的结果,布尔completedSynchronously)在System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureOpen(布尔completedSynchronously)在System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureInteractiveInit(IAsyncResult的结果,在System.ServiceModel.Channels.ServiceMhannel.SendAsyncResult.StartEnsureInteractiveInit()中的System.ServiceModel.Channels.ServiceChannel.SendAsseureInteractive()处于System.ServiceModel.Channels.ServiceChannel.BeginCall(String action,Boolean oneway,ProxyOperationRuntime操作)的System.ServiceModel.Channels.ServiceChannel.SeartAsnsureInteractiveInit() System.ServiceModel上的System.ServiceModel.Channels.ServiceChannel.BeginCall(String action,Boolean oneway,ProxyOperationRuntime operation,Object [] ins,AsyncCallback callback,Object asyncState),Object [] ins,TimeSpan timeout,AsyncCallback callback,Object asyncState) .Channels.ServiceChannelProxy.InvokeBeginService(IMethodCa System.ServiceModel.Channels.ServiceChannelProxy.Invoke上的llMessage methodCall,ProxyOperationRuntime操作(IMessage消息)
在[0]处重新抛出异常:位于x.xxx处System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&msgData,Int32类型)的System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg). xxxxx(String Path,AsyncCallback回调,对象状态)x.xproxy.begininstall(字符串路径,AsyncCallback回调,对象状态)位于C:\ Users\project\AsyncProxy.cs:第38行xxx.MainForm.begininstall(对象发送者) ,EventArgs e)在C:\ Users\project\MainForm.cs中:位于C:\ Users\Gurdip\Desktop\xproject\MainForm.cs中的XPrintV7.MainForm.b__e()的第647行:System.Windows.Forms中的第664行System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代码,CleanupCode backoutCode)上System.Threading.ExecutionContext.runTryCode(Object userData)的System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj)中的.Control.InvokeMarshaledCallbackDo(ThreadMethodEntry tme) ,System userT)在System.Threading.ExecutionContext.RunInternal(Execut System.Windows.Forms.Control上的System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry tme)中的System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback回调,对象状态)中的ionContext executionContext,ContextCallback回调,Object状态. InvokeMarshaledCallbacks()
可能的原因是什么?
该错误消息告诉您,ERROR_NO_DATA当客户端通道堆栈尝试通过命名管道向服务发送消息时,发生Win32错误.仅使用您提供的信息来诊断除此之外很困难,但它可能表明由于前面的WMI错误,命名管道的客户端和服务器端已进入不一致状态.当WMI异常发生时,您的客户端代码可能无法正确管理服务代理实例的状态.
您应该在客户端和服务端启用详细的WCF跟踪,这将更清楚地显示正在发生的事情.
此外,发布一些客户端代码以显示WMI异常发生的位置,以及如何在异常处理中处理服务代理,可以使某人更准确地回答您的问题.
| 归档时间: |
|
| 查看次数: |
11526 次 |
| 最近记录: |