Why does the Office 365 OutlookServices (v1.0.34) .Net client library hang indefinitely?

1.7k Views Asked by At

I’m using the Microsoft.Office365.OutlookServices client library to make calls to Outlook-based services (email, calendar, contacts, etc.) in a Windows app, a Windows Phone app, and an ASP.NET web app. All calls to ExecuteAsync() hang indefinitely, with no errors thrown. Why is this happening?

Here is an example from a Windows Phone app which I've recently upgraded from v.1.0.22 to 1.0.34 of the Microsoft.Office365.OutlookServices client library:

I get my Outlook client:

DiscoveryClient discoveryClient = new DiscoveryClient(
    async () => await GetTokenHelperAsync(_authenticationContext, DiscoveryResourceId));

// Get the specified capability ("Mail").
CapabilityDiscoveryResult result =
    await discoveryClient.DiscoverCapabilityAsync(capability);

outlookClient = new OutlookServicesClient(
    result.ServiceEndpointUri,
    async () => await GetTokenHelperAsync(_authenticationContext, result.ServiceResourceId));

Then I try to send an e-mail message with it (not including the code that creates the message for the sake of brevity):

await outlookClient.Me.SendMailAsync(draft, true);

When I run the app in the emulator, the app hangs at the above line. No errors are thrown.

1

There are 1 best solutions below

2
On

Which version of the Microsoft.Office365.OutlookServices library are you using? If you’re using the version 1.0.34, you might need to update the Microsoft.OData.ProxyExtensions assembly that installs with that version of the OutlookServices NuGet package. Look at your packages.config file. If you have version 1.0.30 of the Microsoft.OData.ProxyExtensions assembly, then that is the source of your problem. You can fix this by installing version 1.0.35 of the Microsoft.OData.ProxyExtensions library.