1

ich eine Menge Fehler immer Antwortcode im Zusammenhang mit ErrorIrresolvableConflict bei dem Versuch, ein EreignisErrorIrresolvableConflict während des Erstellens eines Ereignisses

Stack Trace - at Microsoft.OData.ProxyExtensions.DataServiceContextWrapper.<SaveChangesAsync>d__5e.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Office365CalendarProviderBL.<>c__DisplayClass7_0.<<CreateCalendarEvent>b__0>d.MoveNext() - Inner Exception - Microsoft.OData.Client.DataServiceRequestException: An error occurred while processing this request. ---> Microsoft.OData.Client.DataServiceClientException: {"error":{"code":"ErrorIrresolvableConflict","message":"The send or update operation could not be performed because the change key passed in the request does not match the current change key for the item."}} 
    --- End of inner exception stack trace --- 
    at Microsoft.OData.Client.SaveResult.HandleResponse() 
    at Microsoft.OData.Client.BaseSaveResult.EndRequest() 
    at Microsoft.OData.Client.DataServiceContext.EndSaveChanges(IAsyncResult asyncResult) 
    at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization) 
--- End of stack trace from previous location where exception was thrown --- 
    at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) 
    at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
    at Microsoft.OData.ProxyExtensions.DataServiceContextWrapper.<SaveChangesAsync>d__5e.MoveNext() 

Ich erhalte diese Meldung mit dieser Ausnahme zu erstellen - die Sende- oder Update-Operation nicht sein könnte durchgeführt, weil der Änderungsschlüssel, der in der Anfrage übergeben wurde, nicht mit dem aktuellen Änderungsschlüssel für den Artikel übereinstimmt.

  1. Bitte erläutern, was ist ein Änderungsschlüssel und wie es funktioniert?
  2. Ich bekomme diese Ausnahmen nur von gestern und hat keinen Code geändert. Muss ich etwas an meinem Ende aktualisieren oder fehlt mir etwas?

Ich bin mit V1 DLL - https://api.office.com/discovery/v1.0/me/ ProxyExtension Version - 23

Code: -

// In this method, we are populating event properties later used to create event on calendar. Please verify if I am missing any important property here 
private Event CreateCalEventObj(CalendarMeetingBL meeting, string location, meetingAdditionalDataBL data) 
{ 
    Event calEvent = new Event(); 
    try 
    { 
     calEvent.Subject = WEB.HttpUtility.HtmlDecode(meeting.MeetingName); 
     calEvent.ShowAs = FreeBusyStatus.Busy; 
     if (meeting.EventAlarmInMinutes == -1) 
      meeting.EventAlarmInMinutes = null; 
     calEvent.Reminder = meeting.EventAlarmInMinutes; 
     calEvent.Start = meeting.StartTime; 
     calEvent.End = meeting.EndTime; 
     calEvent.StartTimeZone = meeting.TimeZoneString; 
     calEvent.EndTimeZone = meeting.TimeZoneString; 

     if (!string.IsNullOrEmpty(location) && location.Length <= 500) 
     { 
      calEvent.Location = new Microsoft.Office365.OutlookServices.Location() 
      { 
       DisplayName = CommonBL.FixLineBreakForGooglelocation(WEB.HttpUtility.HtmlDecode(location.Replace("\n", " "))) 
      }; 
     } 
     else if (!string.IsNullOrEmpty(data.Phone)) 
     { 
      calEvent.Location = new Microsoft.Office365.OutlookServices.Location() 
      { 
       DisplayName = "Phone: " + CommonBL.FixLineBreakForGooglelocation(WEB.HttpUtility.HtmlDecode(data.Phone)) 
      }; 
     } 
     else if (!string.IsNullOrEmpty(data.MobileNumber)) 
     { 
      calEvent.Location = new Microsoft.Office365.OutlookServices.Location() 
      { 
       DisplayName = "Mobile: " + CommonBL.FixLineBreakForGooglelocation(WEB.HttpUtility.HtmlDecode(data.MobileNumber)) 
      }; 
     } 
     calEvent.Body = new ItemBody() 
     { 
      Content = CommonBL.RevertLineBreakPlaceHolder((WEB.HttpUtility.HtmlDecode(meeting.MeetingDetails.Replace(@"\\\", "\\")))) 
     }; 
    } 
    catch (Exception ex) 
    { 
     BLFactory.CurrentInstance.LoggingBLObj.InsertLog("Insert logging here"); 
     calEvent = null; 
    } 
    return calEvent; 
} 

// In this method we are creating event on calendar. 
private string CreateCalendarEvent(CalendarMeetingBL meeting, List<ParticipantBL> invitees, string username, string calendarId, OutlookServicesClient service, string location, meetingAdditionalDataBL data, string meetingId = "-1") 
{ 
    var taskCreateMeeting = Task<string>.Run(
      async() => 
      { 
       Event calEvent = CreateCalEventObj(meeting, location, data); 
       if (calEvent != null) 
       { 
        try 
        { 
         //Add invitees to the event 
         foreach (ParticipantBL inviteeItem in invitees) 
         { 
          if (!inviteeItem.IsAdditional) 
          { 
           calEvent.Attendees.Add(new Attendee() 
           { 
            EmailAddress = new EmailAddress() 
            { 
             Address = inviteeItem.Email.Replace("&#39;", "'"), 
             Name = inviteeItem.Name 
            }, 
            Type = AttendeeType.Required, 
            Status = new ResponseStatus() 
            { 
             Response = ResponseType.Accepted, 
             Time = DateTime.Now 
            } 
           }); 
          } 
         } 
        } 
        catch (Exception ex) 
        { 
         BLFactory.CurrentInstance.LoggingBLObj.InsertLog(meeting.MeetingId, username, "Locally User ID is Meeting id AND email is username - Scheduling Logging Exception 3 - Stack Trace - " + ex.StackTrace + " - Inner Exception - " + ex.InnerException + " - meetingObjValues - " + meetingObjValues + " - meetingAdditionalDataObjValues - " + meetingAdditionalDataObjValues + " - username - " + username + " - calendarId - " + calendarId + " - location - " + location + " - meetingId - " + meetingId, meeting.MeetingId); 
         return "-1"; 
        } 

        try 
        { 

         var providerDefault = (String.IsNullOrEmpty(calendarId) ? service.Me.Events : service.Me.Calendars[calendarId].Events); 
         await providerDefault.AddEventAsync(calEvent);   // We are getting Exception here but Event is created in calendar      
         return calEvent.Id;          // Event object is not updated after exception 
        } 
        catch (Exception ex) 
        { 
         BLFactory.CurrentInstance.LoggingBLObj.InsertLog("Insert exception logging here"); 
         return "-1"; 
        } 
       } 
       else 
        return "-1"; 
      } 
     ); 
    Task.WaitAll(taskCreateMeeting); 
    string id = taskCreateMeeting.Result; 
    return id; 
} 

Die Ausnahme, die wir bekommen ist vom Typ Microsoft.OData.Client.DataServiceRequestException aber es ist nicht unter dem dedizierten catch block gefangen

   catch (Microsoft.OData.Client.DataServiceRequestException ex) 
       { 
        BLFactory.CurrentInstance.LoggingBLObj.InsertLog("Insert logging here"); 
        return "-1"; 
       } 

Lassen Sie mich wissen, wenn überhaupt Hing sonst ist erforderlich Vielen Dank im Voraus.

+0

Es ist hilfreich, dieses Problem einzugrenzen, wenn Sie ein Codebeispiel freigeben. –

+0

@FeiXue Ich habe das Codebeispiel aktualisiert. Bitte werfen Sie einen Blick und lassen Sie es mich wissen, wenn Sie noch etwas brauchten. –

+0

Ist ** calendarId ** null oder leer im Code? Var providerDefault = (String.IsNullOrEmpty (calendarId)? Service.Me.Events: service.Me.Calendars [calendarId] .Events); '? Ich schlage auch vor, dass Sie das Fehlerdetail mit dem ** Fiddler ** verfolgen, um den Detailfehler zu sehen. –

Antwort

0

Dies steht nicht in direktem Zusammenhang mit OData - wir haben das Gleiche mit EWS gesehen. Wir haben gerade die zugrundeliegende Race-Bedingung innerhalb des Exchange-Codes gefunden, die dies verursacht hat, und einer unserer Devices hat gerade einen Fix dafür eingecheckt. Daher sollte es bald in der Produktion eingeführt werden.

Es ist nichts falsch mit Ihrem Code, der dies für ein neues Element verursachen würde.

+0

Danke David für das Update. Können Sie sich bitte auch ein anderes Thema ansehen? http://stackoverflow.com/questions/41478331/office-365-default-calendars-id-changes-automatisch Dieses Problem hat eine höhere Priorität für uns. –

+0

Ich habe gerade angefangen, dies zu erleben, aber mit Updates der Nachrichtenkategorien. Es scheint für uns am 17. März 2017 begonnen zu haben. –

Verwandte Themen