我正在开发一个使用 EWS 托管 API 中的 StreamingSubscriptionConnection 对象的应用程序。
当网络连接丢失一段时间后,它会抛出一个异常,其 StackTrace 显示此
System.Collections.Generic.KeyNotFoundException was unhandled
Message=The given key was not present in the dictionary.
Source=mscorlib
StackTrace:
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.Exchange.WebServices.Data.StreamingSubscriptionConnection.IssueSubscriptionFailures(GetStreamingEventsResponse gseResponse)
at Microsoft.Exchange.WebServices.Data.StreamingSubscriptionConnection.HandleServiceResponseObject(Object response)
at Microsoft.Exchange.WebServices.Data.HangingServiceRequestBase.ParseResponses(Object state)
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()
InnerException:
任何人都知道为什么会发生这种情况?
提前致谢。