我正在Silverlight中实现 WCF 服务代理 (NetTcpBinding) 的重新连接机制。服务的操作由计时器并行调用。实现非常简单(就像这里),但是我的应用程序失败时出现异常:
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()
有谁知道问题的根源是什么以及如何解决?