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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -