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

扶醉桌前 提交于 2019-12-11 12:27:37

问题


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:


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.



来源:https://stackoverflow.com/questions/30792928/why-does-the-office-365-outlookservices-v1-0-34-net-client-library-hang-indef

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!