c# - ContactSchema.Birthday for Microsoft.Exchange.WebServices is trhowing exception -


i exporting contacts office365 using microsoft.exchange.webservices. have contactschema.department property working same code throwing exception contactschema.birthday field.

the exception occurs in line:

microsoft.exchange.webservices.data.contact.birthday 

the exception get_birthday() threw exception enter image description here

i have following code contact:

contact c = contact.bind(service, items[i].id, new  propertyset(contactschema.body, contactschema.birthday)); 

any idea of how have handle birthday field?

that error means property wasn't set on contact. birthday optional property means if hasn't been set no value returned. because datetime value can't null, while hasvalue should work test of plumbing in ews managed api doesn't appear work should. recommend testing property first using trygetproperty work without throwing exception eg.

        object birthdayvalue = null;         if (c.trygetproperty(contactschema.birthday,out birthdayvalue))         {             console.writeline(birthdayvalue);         } 

cheers glen


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -