Search code examples
c#exchangewebservicesews-managed-api

ExchangeService FindAppointments returns 'This property was requested, but it wasn't returned by the server' error


I'm using Microsoft.Exchange.WebServices.dll version 15.0.847.30 to interact with functions in Outlook. I am using this call:

EWSData = CurrentEmail.FindAppointments(WellKnownFolderName.Calendar, new CalendarView(t, t.AddDays(1)));

(where t is today +/- however many days the user has clicked from today) which passes the WellKnownFolderName and the CalendarView directly through to a call to ExchangeService.FindAppointments.

I have a couple clients who each have a single user who is getting the 'This property was requested, but it wasn't returned by the server' error on some days and not others. Sometimes it pulls in the first few appointments for a day and leaves off the rest. My email, creating appointments, and add/remove contacts functions are all working for them.

I've traced through the ews-managed-api code from github and found the error is thrown when a property is requested but is null. I'm assuming the code on github is much newer than the version I'm using, but if the error is still caused by that code is in my version, I do not know how to find out what properties are causing the issue.

Since I'm not requesting anything specific but using the generic call with the folder name and a date, I'm quite confused as to what properties would be null and why.

What can I do, without re-compiling my application, to track down the problem properties?


Solution

  • Just a thought: do you have a way of tracing the XML flow between your app and Exchange, e.g. Fiddler? On the error response, you may be able to plow into the XML and see the name of the property causing the issue. Not 100% sure on this, but about the only tactic you can try without rebuilding you app with more diagnostic code in there.