c# - asynctargetingpack and webclient use in WPF -


i creating sample app using vs2012 , targeting .net 4.0 , trying use bcl portability pack .net 4. have following code

webclient client = new webclient(); string result = await client.downloadstringasync(new uri("some uri")); 

i under impression, should work, following error "cannot await 'void' "

what missing?

thanks help

the method call returns void , event-driven... makes incompatible await (see msdn).

you either implement event downloadstringcompleted (without await) or use downloadstringtaskasync instead designed used await.


Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

php - Boolean search on database with 5 million rows, very slow -

css - Text drops down with smaller window -