Assume that you develop an application by using Microsoft Lync Server 2013 Persistent Chat SDK. The application creates multiple endpoints, and users on the endpoints use the application to perform actions in multiple threads. For example, users on the endpoints join a chat room, send a message, and then leave a chat room. In this situation, the application throws the following unhandled exception and then crashes:
Unhandled System.Collections.Generic.KeyNotFoundException
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.Rtc.Collaboration.PersistentChat.Internal.ChatRoomCache.get_Item(Uri uri)
at Microsoft.Rtc.Collaboration.PersistentChat.PersistentChatEndpoint.get_Item(Uri uri)
at Microsoft.Rtc.Collaboration.PersistentChat.Internal.MessageHandler.HandlePartNotify(Object messageIn)
at Microsoft.Rtc.Collaboration.PersistentChat.Internal.MessageHandler.ProcessQueuedMessage(TransportMessage message)
at Microsoft.Rtc.Collaboration.PersistentChat.Internal.MessageRouter.HandleMessage(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at Microsoft.Rtc.Collaboration.PersistentChat.Internal.ChatRoomCache.get_Item(Uri uri)
at Microsoft.Rtc.Collaboration.PersistentChat.PersistentChatEndpoint.get_Item(Uri uri)
at Microsoft.Rtc.Collaboration.PersistentChat.Internal.MessageHandler.HandlePartNotify(Object messageIn)
at Microsoft.Rtc.Collaboration.PersistentChat.Internal.MessageHandler.ProcessQueuedMessage(TransportMessage message)
at Microsoft.Rtc.Collaboration.PersistentChat.Internal.MessageRouter.HandleMessage(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at System.Threading.ThreadPoolWorkQueue.Dispatch()