Live Framework Part III – Coding the first Mesh Application

Ok, so after provisioning your Live Framework CTP account and installing Live Framework SDK and Tools we’ll start to get your hands dirty and write your first Mesh Application.

Fire up Visual Studio, create a new Console Application, and add references to the three SDK assemblies:

  • Microsoft.LiveFX.Client.dll
  • Microsoft.LiveFX.ResourceModel.dll
  • Microsoft.Web.dll

For X64 Windows these should be in C:\Program Files (x86)\Microsoft SDKs\Live Framework\v0.91\API Toolkits\.Net Library. In X86 Windows you can find them in C:\Program Files\Microsoft SDKs\Live Framework\v0.91\API Toolkits\.Net Library.

Next you’ll need to connect to your mesh. You can do that, instantiating a LiveOperatingEnvironment object and calling the Connect method on it:

var endpoint = new LiveOperatingEnvironment();
var token = new NetworkCredential(
	"your_windows_live_id",
	"your_password").GetWindowsLiveAuthenticationToken();

endpoint.Connect(token,
	AuthenticationTokenType.UserToken,
	new Uri(“https://user-ctp.windows.net”),
	new LiveItemAccessOptions(true, true));

That’s it ! Now you should be connected to your mesh. Let’s add some data to it.

var meshObject = new MeshObject("My Mesh Object");
endpoint.Mesh.MeshObjects.Add(ref meshObject);

Easy, isn’t it. Now, this doesn’t do much. But it’s a start. In next post we’ll add a bit of usefulness to our test application and deploy it to the mesh.

See you.

Share this post

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Send to twitter

Leave a Reply