After upgrading to 17.4, Aspose Email throws an Object reference exception when trying to GetContacts from office365.
This is the code I’m using:
var client =EWSClient.GetEWSClient(MAILSERVER, mailAddress, mailPassword, domain);
var contactCollection = client.GetContacts(client.MailboxInfo.ContactsUri);
This is the error I get:
2017/05/23 12:28:03.604 EXCEPTN [26] Services.DataService.Helpers.HttpStatusCodeExceptionHandler Handle - System.NullReferenceException from Aspose.Email 2017/05/23 12:28:03.619 EXCEPTN [26] Services.DataService.Helpers.HttpStatusCodeExceptionHandler Handle - Object reference not set to an instance of an object. 2017/05/23 12:28:03.619 EXCEPTN [26] Services.DataService.Helpers.HttpStatusCodeExceptionHandler Handle - at #=qHx$H819s6J8V8_2Ad3PdzPWfCuzyVmTBJG$1SpkOykZULl4DXYPkQDi2w8i2y25Q.#=qyBTs6Pm2XT7rrY_lTARbYAXxNwFe2_ZmWVzZbGSX4bk=(ContactItemType #=qmVrhCJV6clysV3ksht4VgQ==, List`1 #=q3j$EWAIrro_hVJZ65SVzXq2hZgNr8TS$0JctaJu_Ypo=)at #=q$URVFJ46Py_sB1wW4BhrMlxBBAff4rCUmTy697lRNldEs5shCrH0bISWYGq4qZttr2BeOO9wOaIaWYtwWk6gnQ==.#=qelzCaEmFjO5lCC_iw6H$rw==(List`1 #=qXbHE6Sf3DIOashJDq1P$iA==, ExchangeListContactsOptions #=qnVinIpv3grjH1YTaHEyVNw==) at #=q$URVFJ46Py_sB1wW4BhrMlxBBAff4rCUmTy697lRNldEs5shCrH0bISWYGq4qZttr2BeOO9wOaIaWYtwWk6gnQ==.GetContacts(String #=q9wodUnHA4FXo71BdJz4meA==) at Services.DataService.Controllers.DocumentsController.Contacts(String emailpass) in C:\Workspace\6.2Patch\Source\Services\REST\DataService\Controllers\DocumentsController.cs:line 1447 at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)