The World’s Leading Microsoft .NET Magazine
   
 
The .NET Addict's Blog

My Top Tags

                                                           

My RSS Feeds








I heart FeedBurner

Latest Diggs - Programming

Computers Blogs - Blog Top Sites

Site Hits

Total: 3,822,723
since: 19 Jan 2005

Live Mesh Tutorial 1 - Hello Live Mesh

posted Thu 06 Nov 08

Disclaimer: This blog post is written against the October/November CTP of the Live Framework/Live Mesh. As they update the CTP and it approaches beta I will post subsequent blog posts talking about breaking changes, differences, etc.

The first thing you're going to need to build your Live Mesh application is a token. You can register for the Azure CTP over at http://www.microsoft.com/azure/register.mspx . When you register for the services you will eventually receive some tokens. You will get a token for Windows Azure, which I have talked about in previous blog posts. You will also eventually get a token for the Live Framework, and there is another type of token for .NET Services and SQL Data Services.

Once you claim that token you will be able to go to the Azure portal and create a new application. Keep in mind that what you're creating online is the Application Registry, not the application itself. This is essentially a globally unique placeholder and command center for your Live Mesh application. You will be asked if you want to create a Live Framework-enabled Website or a Mesh-enabled Web Application. The website option leads you down the path of creating a plain web application that is backed by the Live Framework. The Mesh-enabled Web Application choice (the topic of this blog post) will allow you to create a Silverlight application that can synchronize itself and its data throughout a Mesh.

Your new "Hello World" application profile page looks something like this:

At this point, you can minimize that and go open Visual Studio 2008 SP1. You are going to need the Live Framework SDK, Silverlight 2.0 Tools for VS2008 SP1, and the Live Framework tools for Visual Studio. If you received the welcome e-mail with your token, then you've got instructions on how to obtain all of those files.

Once in Visual Studio, create a new Live Framework project by selecting the "Silverlight Mesh-enabled Web Application" template under the "Live Framework" group. You'll end up with two projects in your new solution: A project that is essentially a container for your Mesh app, and then a project that is the actual Silverlight application.

Now you can hit F5 to debug your application, but you're going to notice something very different about this app that you don't see with regular Silverlight or WPF applications. As soon as you hit F5, you will see a prompt that looks something like this:

This is basically telling you that you're going to need to upload a package containing your app to the portal before you can debug it. This is a one time step. You only need to upload this package the first time, all subsequent changes are dealt with automatically by the Visual Studio publish or run commands. Click the link that says "Copy full path of Hello Mesh to clipboard". This will give you the upload path of the ZIP file that VS2008 has already created for you. Alt-Tab back over to the Developer Portal and upload this package by clicking the "Upload Package" button. Click the "Browse" button and then paste the full path of the file into the explorer prompt. Then click "Upload".

A few seconds later, the Azure Portal will have crunched through your app manifest and found all the information it needs. You'll actually see a very Vista-looking progress dialog that's still in-browser.

Almost done. Now scroll down on your app profile screen and you should see a URL marked "Application Self Link". Copy that URL and put it in the empty box in the Visual Studio dialog (shown above). This tells Visual Studio the one true globally unique identifier for your application.

Click OK and you'll continue through the publish and deploy wizard. A few seconds later, you'll see your browser open and it will be pointed at your Live Desktop. On your Live Desktop you'll have a new icon representing the application you just created. A few seconds after that (the CTP portal is currently pretty slow) the Silverlight app should start loading. Note that your application is running "from the cloud" and it has a "mesh bar" attached to the side of it, as shown below:

If you really want to see the true power of Mesh, wait a few seconds and then take a look at your desktop. By desktop here, I mean your local Windows desktop, the one with your "My Computer" icon, etc. You'll see a shortcut to your Mesh application! If you double-click that application icon, your Silverlight Mesh application will run with no browser chrome and look like a native application.

In the next tutorial I'm going to talk about how to actually do something useful with this new Mesh application that you've created.

tags:          

links: digg this    del.icio.us    technorati    reddit

AddThis Social Bookmark Button




Tag Related Posts

What's New in Silverlight 3

Fri 20 Mar 09 2:38 P GMT-05

Live Framework April 2009 CTP is out!

Fri 13 Mar 09 12:11 P GMT-05

SSDS loses an "S" and gains some awesome

Wed 11 Mar 09 11:42 A GMT-05
tags:              

Live Mesh Tutorial 1 - Hello Live Mesh

Thu 06 Nov 08 2:33 P GMT-05

Microsoft Windows Azure Distilled

Tue 28 Oct 08 1:42 P GMT-05

The Evolution of the Cloud - Then and Now

Mon 06 Oct 08 12:34 P GMT-05

Microsoft's Lofty Direction

Sun 05 Oct 08 2:30 P GMT-05

MobileMe vs. Live Mesh Throwdown - Round 1

Wed 16 Jul 08 10:33 A GMT-05

MobileMe vs. Live Mesh - Round 1

Wed 11 Jun 08 12:20 A GMT-05

My Silverlight Plugin has expired - WTF?!?

Thu 08 Nov 07 7:34 P GMT-05
tags:    

Silverlight 1.1 Alpha Refresh

Fri 10 Aug 07 2:09 P GMT-05
tags:    

My Appearance in the RIA Shootout on sys-con.tv

Tue 05 Jun 07 11:41 A GMT-05
tags:              

Silverlight and Astoria - First Impressions

Mon 04 Jun 07 1:40 A GMT-05
tags:    

I'm going to be on TV (sort of)

Sat 02 Jun 07 12:19 P GMT-05
tags:              

Silverlight Revisited

Sat 21 Apr 07 9:48 P GMT-05
tags:    

Will Silverlight be DOA?

Mon 16 Apr 07 8:02 P GMT-05