我有一个使用DualHttpBindings回调的wcf服务。该服务发现它们时将客户端的搜索结果的数据集推回(长时间运行搜索)。更新到.net 4.0后wcf回调异常
这在.net 3.5中正常工作。自从我更新到.NET 4.0后,它就会抛出一个System.Runtime.FatalException,它实际上会杀死IIS工作进程。我不知道如何去解决这个问题。任何建议的赞赏。
从所得事件日志的信息被粘贴在下面:
发生未处理的异常和 过程被终止。
应用程序ID:/ LM/W3SVC/2/ROOT/CP
进程ID:5284
>例外: System.Runtime.FatalException
>信息:对象引用未设置为 对象的实例。
堆栈跟踪:在在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc & RPC) System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc & RPC)在 System.ServiceModel.Dispatcher .MessageRpc.Process(布尔型 isOperationContextSet)at System.ServiceModel.Dispatcher.ChannelHandler.DispatchAndReleasePump(RequestContext request,Boolean cleanThread, OperationContext currentOperationContext)在 System.ServiceModel.Dispatcher.ChannelHandler.HandleRequest(RequestContext的 请求,的OperationContext currentOperationContext)在 System.ServiceModel.Dispatcher.ChannelHandler.AsyncMessagePump(IAsyncResult的 结果)在 System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame (IAsyncResult的 结果)在 System.Runtime.AsyncResult.Complete(布尔 completedSynchronously)在 System.Runtime.InputQueue
1.AsyncQueueReader.Set(Item item) at System.Runtime.InputQueue
1.Dispatch() 在 System.ServiceModel.Channels.ReliableDuplexSessionChannel.ProcessDuplexMessage(WsrmMessageInfo 信息)在 System.ServiceModel.Channels.ReliableDuplexSessionChannel.HandleReceiveComplete(IAsyncResult的 结果)在 System.ServiceModel.Channels.ReliableDuplexSessionChannel.OnReceiveCompletedStatic在 系统(IAsyncResult的 结果)在 System.Runtime.Fx.AsyncThunk.UnhandledExceptionFrame(IAsyncResult的 结果) .Runtime.AsyncResult.Complete(布尔 completedSynchronously)在 System.ServiceModel.Channels.ReliableChannelBinder1.InputAsyncResult
1.OnInputComplete(IAsyncResult的 结果)在 System.Runtime.Fx.AsyncThunk。UnhandledExceptionFrame(IAsyncResult的 结果)在 System.Runtime.AsyncResult.Complete(布尔 completedSynchronously)在 System.Runtime.InputQueue1.AsyncQueueReader.Set(Item item) at System.Runtime.InputQueue
1.Dispatch() 在 System.Runtime.IOThreadScheduler.ScheduledOverlapped.IOCallback(UInt32的 的errorCode, UInt32的的numBytes, nativeOverlapped * nativeOverlapped)
在 System.Runtime.Fx.IOCompletionThunk.UnhandledExceptionFrame(UInt32的 错误,UInt32的bytesRead, nativeOverlapped * nativeOverlapped)
在 System.Threading._IOCompletionCa llback.PerformIOCompletionCallback(UInt32的 的errorCode,UInt32的的numBytes, NativeOverlapped * pOVERLAP)>的InnerException: > System.NullReferenceException
消息:对象没有设置为 的一个实例目的。
堆栈跟踪:在 System.Web.HttpApplication.ThreadContext.Enter(布尔 setImpersonationContext)在 System.Web.HttpApplication.OnThreadEnterPrivate在 System.Web.AspNetSynchronizationContext.CallCallbackPossiblyUnderLock(布尔 setImpersonationContext)(SendOrPostCallback 在 System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc回调,对象状态)在 System.Web.AspNetSynchronizationContext.CallCallback(SendOrPostCallback 回调,对象状态) rpc)
+1票。感谢詹姆斯,你节省了我的时间:) – 2012-06-19 05:17:28
这样做的伎俩!尽管我的场景与文章有点不同,因为在调用回调方法之前抛出异常。 – Jan 2016-11-16 15:53:33