none
[E2010] [EWSMA] [C#] [Windows]: "Periods have duplicate id" exception when getting user availability RRS feed

  • Question

  • Hello Everyone,

    We have an application that reads user and meeting room availability from exchange online server using EWSMA(v 2.2.0). We are referring the following for development
    https://docs.microsoft.com/en-us/exchange/client-developer/exchange-web-services/how-to-get-free-busy-information-by-using-ews-in-exchange

    We are getting "Periods have duplicate id" exception when using exchange server version 2010. User availability and meeting room availability works with version 2007SP1.
    Tried setting the timezone while creating exchange service object, but that didn't work either.

    Any suggestions regarding this issue will be helpful

    Following are exception message and code we are using.

    ExchangeService GetExchangeService() { // Create exchnage Service ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010, TimeZoneInfo.Local); string password = OutlookSetting.AdminPassword; service.Credentials = new WebCredentials(OutlookSetting.AdminEmail, password); service.Url = new Uri(OutlookSetting.ExchangeUrl.Trim()); return service; }

    GetMeetingTimeSlots(IList<AttendeeProperty> request, DateTime startDate, int duration)

    { service = GetExchangeService(); var attendees = request.SelectMany(p => p.AttendeeEmails.Select(z => new AttendeeInfo { SmtpAddress = z.Trim(), AttendeeType = (MeetingAttendeeType)Enum.Parse(typeof(MeetingAttendeeType), p.AttendeeType.ToString()), ExcludeConflicts = false })); // Specify options to request free/busy information and suggested meeting times. AvailabilityOptions options = new AvailabilityOptions { MaximumSuggestionsPerDay = OutlookSetting.MaximumSuggestionsPerDay, MeetingDuration = duration, GoodSuggestionThreshold = OutlookSetting.GoodSuggestionThreshold, MaximumNonWorkHoursSuggestionsPerDay = OutlookSetting.MaximumNonWorkHoursSuggestionsPerDay, MinimumSuggestionQuality = SuggestionQuality.Excellent, DetailedSuggestionsWindow = new TimeWindow(startDate, startDate.AddDays(OutlookSetting.SuggestionsWindow)), RequestedFreeBusyView = FreeBusyViewType.FreeBusy }; // Return free/busy information and a set of suggested meeting times. // This method results in a GetUserAvailabilityRequest call to EWS. GetUserAvailabilityResults results = service.GetUserAvailability(attendees, options.DetailedSuggestionsWindow, AvailabilityData.FreeBusy, options);

    }


    Tuesday, July 30, 2019 5:47 AM