Environment: VS 2013 in Win 8.1
I tried the sample Store app in "Working with the code examples" (really for beginners as I am).
The code is:
// Signs the user into their Microsoft account.
private async void SignIn(object sender, RoutedEventArgs e)
{
try
{
LiveAuthClient auth = new LiveAuthClient();
LiveLoginResult loginResult = await auth.LoginAsync(new string[] { "wl.basic" });
if (loginResult.Status == LiveConnectSessionStatus.Connected)
this.infoTextBlock.Text = "Signed in";
}
catch (LiveAuthException exception)
{
this.infoTextBlock.Text = "Error signing in: " + exception.Message;
}
}
At the line .. loginResult = await auth.... I get an exception saying:
"An exception of type 'System.NullReferenceException' occurred in mscorlib.dll but was not handled in user code
Additional information: Object reference not set to an instance of an object."
Note that according to VS-locals the variable 'auth' is NOT null at this point!
What's wrong?