Running the Messenger Samples

PulseLogo96

I downloaded the sample app for the Windows Live Messenger bits in preparation for our talk at Remix next week.  If you haven’t played with it, the WebToolkit Sample site is a great starting place!  There’s a couple of things you have to do to get them running so I thought it’d be a good idea to write these down for others.

Firstly, you’ll need an application id, so make sure you go to the Azure Services Developer Portal: https://lx.azure.microsoft.com/Cloud/Provisioning/Default.aspx and create a new project with a Live Services: Existing APIs type. Make sure you remember the domain name and URL you chose e.g. I picked remixdemo.com.au and return URL of http://remixdemo.com.au/Messenger/Default.aspx and also note down your app_id and secret key as you’ll need them to run the samples.

Make sure you add an entry in your hosts file for the domain you chose so you can run the application locally.  To do this open notepad as administrator, and open the hosts file located at C:\Windows\System32\drivers\etc and create an entry like: 127.0.0.1    remixdemo.com.au

Next, I went to IIS and created a virtual directory called Messenger and pointed it to the SampleSite. To run the application I browsed to http://remixdemo.com.au/messenger/Default.aspx.

Make sure you setup your site in the web.config to use your app_id, secret key and correct urls.  The one that caught me out was the app_provisioned_usertoken.  I was getting an exception in the User.cs class for consent.IsValid() until I set the value to empty string e.g.

<add key="app_provisioned_usertoken" value=""></add>

Make sure you set the app_logo to point to the pulse logo so your login screen has the correct image e.g.

<add key="app_logo" 
     value="http://remixdemo.com.au/messenger/App_Images/PulseLogo.gif">
</add>