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
Post a Comment