Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

Commented Unassigned: wp8 app hanging when using tweetinvi with async/await [2282]

$
0
0
hi there, when I using tweetinvi with this code in my wp8 application:
var url = CredentialsCreator.GetAuthorizationURL(credentials);
the app hanged out.
after I debugged through, i found out that, the following code in WebHelper class coursed deadlock:

```
public WebResponse GetWebResponse(WebRequest webRequest)
{
Task<WebResponse> requestTask = Task.Factory.FromAsync<WebResponse(webRequest.BeginGetResponse, webRequest.EndGetResponse, webRequest);
requestTask.Wait();
return requestTask.Result;
}
```
the code "requestTask.Wait();" never got to run.
this post showes how deadlock happened: [Don't Block on Async Code](http://blog.stephencleary.com/2012/07/dont-block-on-async-code.html)

but i don't know how to solve the problem, should i make all the method call asynchronous? such as CredentialsCreator.GetAuthorizationURL.

any way, thanks for all the hard work! :D
Comments: ** Comment from web user: im_wower **

hi, i've changed all wp8 interface and implemetions to async/await pattern, it's a lot of work to do, but finally it works, cheers!


Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>