locked
GetAsync in WP7 why not working?

    Question

  • Hi,

    What is wrong my code? This is a Windows Phone 7.1 project (vb language):

    client = New LiveConnectClient(e.Session)

    Dim operationResult As LiveOperationResult = Await client.GetAsync("me")

    I get an error (GetAsync("me")): Expression does not produce a value

    In Windows Phone 8 project this working, but in 7.1 not.

    Thanks for your help.

    Saturday, December 22, 2012 5:13 PM

Answers

  • The async/await syntax is only supported in Live SDK for WP8.

    For WP7, you need to use the event pattern. e.g.

    LiveConnectClient connect = new LiveConnectClient(e.Session);
            connect.GetCompleted +=
                new EventHandler<LiveOperationCompletedEventArgs>(greetUser_GetCompleted);
            connect.GetAsync("me");

    Thanks,

    Lin

    Wednesday, January 2, 2013 8:13 PM
    Moderator

All replies

  • The async/await syntax is only supported in Live SDK for WP8.

    For WP7, you need to use the event pattern. e.g.

    LiveConnectClient connect = new LiveConnectClient(e.Session);
            connect.GetCompleted +=
                new EventHandler<LiveOperationCompletedEventArgs>(greetUser_GetCompleted);
            connect.GetAsync("me");

    Thanks,

    Lin

    Wednesday, January 2, 2013 8:13 PM
    Moderator
  • Ok,

    thanks for your answer!

    Monday, January 7, 2013 6:19 PM