2011-05-15 123 views
9

我在WCF代理中调用方法,其中绑定名为pipes。目前,代码失败(与wmi有关 - 代码的作用),但是当我在同一个代理中执行另一种方法时,出现此错误:写入管道时发生错误:无法识别的错误232(0xe8)

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

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

服务器堆栈跟踪: 在System.ServiceModel.Channels.StreamConnection.BeginWrite(字节[]缓冲液,的Int32偏移的Int32大小,布尔立即,时间跨度超时回调的AsyncCallback,对象状态) 在系统。 ServiceModel.Channels.FramingDuplexSessionChannel.SendAsyncResult.WriteCore() 在System.ServiceModel.Channels.FramingDuplexSessionChannel.SendAsyncResult..ctor(FramingDuplexSessionChannel信道,消息的消息,时间跨度超时回调的AsyncCallback,对象状态) 在System.ServiceModel.Channels.FramingDuplexSessionChannel .OnBeginSend(消息消息,TimeSpan超时,AsyncCallback回调,对象状态) at System.ServiceModel.Channels.OutputChannel.BeginSend(Message message,TimeSpan在System.ServiceModel.Dispatcher.DuplexChannelBinder.BeginRequest(消息消息,TimeSpan超时,AsyncCallback回调,对象状态) at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartSend(Boolean completedSynchronously) 在System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureOpen(IAsyncResult的结果,布尔completedSynchronously) 在System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureOpen(布尔completedSynchronously) 在System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.FinishEnsureInteractiveInit( IAsyncResult结果,布尔已完成同步) at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.StartEnsureInteractiveInit() at S ystem.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消息)

异常在[0]重新排列: 在System.Runtime.Remoting.Proxies.Rea lProxy.HandleReturnMessage(即时聊天reqMsg,即时聊天retMsg) 在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData & MSGDATA,的Int32类型) 在x.xxx.xxxxx在(字符串路径,AsyncCallback的回调,对象状态) C:\ Users \ project \ AsyncProxy.cs中的x.xproxy.begininstall(String path,AsyncCallback callback,Object state):第38行 位于C:\ Users \ project中xxx.MainForm.begininstall(Object sender,EventArgs e) \ 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) 在System.Windows.Forms.Control.InvokeMarshaledCallbackHelper(Object obj) at System.Threading.ExecutionContext .runTryCode(对象userData) 在System.Threading上的System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode代码,CleanupCode backoutCode,Object userData) 。ExecutionContext.RunInternal(的ExecutionContext的ExecutionContext,ContextCallback回调,对象状态) 在System.Threading.ExecutionContext.Run(的ExecutionContext的ExecutionContext,ContextCallback回调,对象状态) 在System.Windows.Forms.Control.InvokeMarshaledCallback(ThreadMethodEntry TME) 在系统.Windows.Forms.Control.InvokeMarshaledCallbacks()

什么是可能的原因是什么?

+0

http://wildermuth.com/2009/09/10/Using_Large_Message_Requests_in_Silverlight_with_WCF – 2011-05-15 02:10:34

+0

谢谢,我会尽力的。但是,我传递给wcf服务的是一个字符串(这是一个文件路径),一个回调方法委托,以及一个状态对象(我为此传入一个空字符串),但这几乎不能推动出来? – dotnetdev 2011-05-15 02:13:23

回答

5

错误消息告诉你,当客户端通道堆栈试图通过命名管道将消息发送到服务发生的Win32错误​​。除了仅用您提供的信息进行诊断之外,很难进行诊断,但可能表明由于前面的WMI错误导致命名管道的客户端和服务器端已进入不一致状态。当WMI异常发生时,您的客户端代码可能无法正确管理服务代理实例的状态。

您应该启用详细跟踪WCF在客户端和服务双方,这将为正在发生的事情更清晰的画面。

另外,在发布你的一些客户端代码显示在WMI异常发生时,业务代理是如何在异常处理处理,可以使一个人更准确地回答你的问题。