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

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -