Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

An unhanded exception occurs on a Lync Server 2013 Persistent Chat SDK-based application

View products that this article applies to.


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()

↑ Back to the top


This issue is caused by a timing issue that occurs between two threads. When one thread deletes an item in a dictionary, and then another thread tries to access the item in the dictionary, the application throws an unhandled KeyNotFoundException exception. Then, the application crashes.

↑ Back to the top


To resolve this issue, install the following cumulative update:
2835432 Description of the cumulative update 5.0.8308.420 for Lync Server 2013, Core Components: July 2013

↑ Back to the top

More Information

For more information about Lync Server 2013 Persistent Chat SDK, go to the following Microsoft website:

↑ Back to the top

Keywords: kbqfe, kbfix, kbsurveynew, kbexpertisebeginner, kberrmsg, kb

↑ Back to the top

Article Info
Article ID : 2846484
Revision : 1
Created on : 1/7/2017
Published on : 8/27/2013
Exists online : False
Views : 231