1
我在Silverlight中實現WCF服務代理(NetTcpBinding)的重新連接機制。服務的操作被計時器並行地調用。實現方法非常簡單(like here),但表格時,我的應用程序failes有例外:Silverlight中WCF重新連接
Uncaught Error: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.NullReferenceException: Object reference not set to an instance of an object.
at System.Net.Sockets.SocketAsyncEventArgs.FinishOperationAsyncFailure(Exception exception, Int32 bytesTransferred, SocketFlags flags)
at System.Net.Sockets.Socket.DoResolve(DnsEndPoint dnsep, SocketAsyncEventArgs usersArgs)
at System.Net.Sockets.Socket.StaticResolveCallback(Object args)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
有誰知道什麼是問題的根源,以及如何解決呢?
你能告訴你的源?看起來像一個簡單的空引用異常,可能是您的代碼中的問題。 – gideon 2012-04-09 04:22:43
請看一下答案。 – 2012-04-14 11:26:36