Hello WebDevs
i have some code which updates contact items within a specific mailbox. i use EWS to execute the request which sends multiple updates through a threadpool.
the method uses (contact.save) when adding a new record to the mailbox and does not seem to have a problem. The problem only occurs when trying to update a record.
The code simply is
contact = Contact.Bind(_exchangeService, new ItemId(sUniqueID));
contact.Update(ConflictResolutionMode.AlwaysOverwrite);
all the variables required are present whent he code runs.
The stack Trace is:
System.Exception was unhandled
HResult=-2146233088
Message=Problem with Updating Contact (080520144)
StackTrace:
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(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.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
InnerException: Microsoft.Exchange.WebServices.Data.ServiceResponseException
HResult=-2146233088
Message=The operation can't be performed because the item is out of date. Reload the item and try again.
Source=Microsoft.Exchange.WebServices
StackTrace:
at Microsoft.Exchange.WebServices.Data.ServiceResponse.InternalThrowIfNecessary()
at Microsoft.Exchange.WebServices.Data.ServiceResponse.ThrowIfNecessary()
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalUpdateItems(IEnumerable`1 items, FolderId savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution,
Nullable`1 messageDisposition, Nullable`1 sendInvitationsOrCancellationsMode, ServiceErrorHandling errorHandling)
at Microsoft.Exchange.WebServices.Data.ExchangeService.UpdateItem(Item item, FolderId savedItemsDestinationFolderId, ConflictResolutionMode conflictResolution, Nullable`1 messageDisposition,
Nullable`1 sendInvitationsOrCancellationsMode)
at Microsoft.Exchange.WebServices.Data.Item.InternalUpdate(FolderId parentFolderId, ConflictResolutionMode conflictResolutionMode, Nullable`1 messageDisposition, Nullable`1 sendInvitationsOrCancellationsMode)
at Microsoft.Exchange.WebServices.Data.Item.Update(ConflictResolutionMode conflictResolutionMode)
InnerException:
i have to admit, i am stumped here. i have trawled through the web to find out where this could possibly be going wrong but cannot find anything useful.