await client.queryasync 耗时太长

await client.queryasync taking too long

您好,我正在使用 Sales force 的 Developer force 来获取帐户详细信息,我在执行时没有收到任何响应 等待,响应时间太长,销售人员中有任何替代方法等待

var 结果=等待client.QueryAsync(constants.AccountsQuery);

this is running fine in Console application, in MVC 5 Controller, its giving Unlimited TImeout Issue

最有可能的是,这意味着在您的调用堆栈的更上方,一些代码正在调用异步然后阻塞它 returns 的任务(使用 .Result.Wait().GetAwaiter().GetResult())。解决方案是:don't block on asynchronous code. Instead of blocking, use async all the way。将 Result/Wait 更改为使用 await,编译器将从那里引导您。