Before you call any Windows Live ID APIs for client applications, you must first add a reference to the component in Visual Studio.
-
Open your project in Visual Studio.
-
In Solution Explorer, right-click References, and then click Add Reference.
-
In Component Name, locate Microsoft.WindowsLive.ID.Client, select it, and then click OK.
-
Expand the References node, and then click Microsoft.WindowsLive.ID.Client.
-
In the Properties window (shown here), set the Specific Version property to false.
To use the reference in code, you must include it with either the using directive (in C#) or an Imports statement (in Visual Basic). From the sample application:
using Microsoft.WindowsLive.Id.Client;
We recommend that you declare the variables to contain instances of the IdentityManager and Identity objects at the class level so that all your code can access them. From the sample application:
public partial class MainWindow : Form
{
IdentityManager oIDMgr;
Identity oID;
Important: |
|---|
|
If the variable that contains the IdentityManager instance falls out of scope, all Identity objects created from it will be invalid.
|
Tasks
Running the Windows Live ID Sample Application
Concepts
How to Automatically Sign In the User
Implementing Automatic Sign-in
Code Samples for Windows Live ID for Client Applications