windows 8 - SkyDrive API access code sometime works sometime does not works -
i trying access skydrive content code. following code worked before suddently stopped executing second result. not sure microsoft has done in behind! please help. please not scopes valid , app win8 has got access.
var authclient = new liveauthclient(); var scopes = new[] { "wl.signin", "wl.skydrive", "wl.basic" }; task<liveloginresult> resulttask = authclient.loginasync(scopes); var client = new liveconnectclient(resulttask.result.session); dynamic result1 = client.getasync("me/skydrive"); dynamic result2 = result1.result; result1 = client.getasync("me/skydrive"); result2 = result1.result;
thanks kajal
your code lacking async/await.
if code within event body use async void
return type otherwise async task<t>
t
class name of return type data.
var authclient = new liveauthclient();
var scopes = new[] { "wl.signin", "wl.skydrive", "wl.basic" };
task resulttask = await authclient.loginasync(scopes);
var client = new liveconnectclient(resulttask.result.session);
dynamic result1 = await client.getasync("me/skydrive");
dynamic result2 = result1.result;
result1 = await client.getasync("me/skydrive");
result2 = result1.result;
Comments
Post a Comment