8 Comments

imageOne small tip if you’re creating a Windows 8 Metro app and want to update the live tile periodically using the TileUpdater-class: The request made by the OS for the live tile update doesn’t set the Content-Type so make sure that you backend is actually returning XML by default.

I encountered this when I built my app’s backend using ASP.NET Web Api and noticed that the live tile updates weren’t actually working. The backend was returning JSON instead of the XML because that’s the default format for the Web Api. In my case the backend only serves the live tile updates so I completely removed the JSON-formatter:

var config = new HttpSelfHostConfiguration("http://localhost:8080");

config.Routes.MapHttpRoute("Default", "api/{controller}/{id}", 
    new { id = RouteParameter.Optional });

config.Formatters.RemoveAt(0);

using (var server = new HttpSelfHostServer(config)) 
{ 
    server.OpenAsync().Wait();

    Console.WriteLine("Press Enter to quit."); 
    Console.ReadLine(); 
}

Now the backend is returning XML and the periodic live tile updates work properly.

Comments

Comment by Free Porno

Free Porno...

WinRT Gotcha: Periodic Live Tile Updates from the App doesn’t set Content-Type Header to XML for the HTTP Request - Mikael Koskinen...

Comment by fake oakleys for sale

fake oakleys for sale...

I'm not sure why but this blog is loading incredibly slow for me. Is anyone else having this issue or is it a problem on my end? I'll check back later on and see if the problem still exists....

Comment by video sex

video sex...

Engine Optimization? I'm trying to get my blog to rank for some targeted keywords but I'm not seeing very good gains. If you know of any please share....

Comment by toms shoes sale

toms shoes sale...

There are some attention-grabbing deadlines in this article but I don抰 know if I see all of them middle to heart. There's some validity however I'll take maintain opinion till I....

Comment by Coach Factory

Coach Factory...

It's extremely helpful for me. Massive thumb up for this blog publish!Pls check out my web site as well and let me know what you think....

Comment by oakley outlet

oakley outlet...

Can I simply say what a aid to seek out somebody who really is aware of what theyre talking about on the internet. You positively know find out how to make it important....

Comment by Coach Outlet

Coach Outlet...

Post thanks for share. more wait .. ?...

Comment by ugg outlet

ugg outlet...

MK Outlet michael kors outlet michael kors handbags...