Hello Team,
We are using Exchange Web Service (EWS) to connect to Microsoft exchange server to get the busy slots from outlook and identify the availability. But we are frequently encountered with the issue with the message "An item with the same key has already
been added" and the error is returned from
at Microsoft.Exchange.WebServices.Data.ExchangeServiceBase.SaveHttpResponseHead ers(WebHeaderCollection headers)
From the initial search in internet we came to know the issue is with Microsoft Exchanage API, where in the method SaveHttpResponseHeaders(WebHeaderCollection headers) has some issue in concatenating the key value pairs if it has a duplicate entries.
For ref: https://github.com/OfficeDev/ews-managed-api/issues/45
So we would like to know if our understanding is correct and is any there any resolution to avoid this issue. Else if this is an issue and Microsoft has to fix this issue, we would like to know when the possible fix will be released.
There is a lot of performance hit on application and most number of users has been affected with this issue, So we believe your resolution will help us to sort out this issue.
please find the details below :
EVENT LOG
==========================
Log Name: Application
Source: Exchange Web Service
Date: 15/02/2016 14:49:02
Event ID: 400
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: CSSPWFBS01.admin
Description:
Application fault - an unexpected exception was caught
The exception was:
Exception
Type : System.ArgumentException
Message : An item with the same key has already been added.
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Insert(TKey, TValue, Boolean)
Source : mscorlib
HResult : -2147024809
Stack Trace:
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.Exchange.WebServices.Data.ExchangeServiceBase.SaveHttpResponseHead ers(WebHeaderCollection headers)
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(IE wsHttpWebResponse response)
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.FindAppointments(FolderI d parentFolderId, CalendarView calendarView)
at EWSHelper.SearchCalendar(String server, String alias, ResourceType amType, DateTime start, DateTime end, Int32 itemViewSize, Boolean usingThreadpool)
[server 'csexdag2w01', mailbox 'jennifer.griffiths']
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name=" Exchange Web Service" />
<EventID Qualifiers="0">400</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2016-02-15T14:49:02.000000000Z" />
<EventRecordID>903090</EventRecordID>
<Channel>Application</Channel>
<Computer>CSSPWFBS01.admin</Computer>
<Security />
</System>
<EventData>
<Data>Application fault - an unexpected exception was caught
The exception was:
Exception
Type : System.ArgumentException
Message : An item with the same key has already been added.
Data : System.Collections.ListDictionaryInternal
TargetSite : Void Insert(TKey, TValue, Boolean)
Source : mscorlib
HResult : -2147024809
Stack Trace:
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.Exchange.WebServices.Data.ExchangeServiceBase.SaveHttpResponseHead ers(WebHeaderCollection headers)
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(IE wsHttpWebResponse response)
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.FindAppointments(FolderI d parentFolderId, CalendarView calendarView)
at EWSHelper.SearchCalendar(String server, String alias, ResourceType amType, DateTime start, DateTime end, Int32 itemViewSize, Boolean usingThreadpool)
---------------------------------------------------------------------------------------------------------------------------------------------
Thanks & Regards,
Ammeraju