Configuring IIS 7.0 or IIS 6.0 for Silverlight Applications

If your having a lot of difficulty getting a Silverlight application to work on your web server and can’t work out what the problem might be even after the Silverlight assemblies are registered on server and .NET framework is up-to-date then this might be what your missing. IIS7 for Windows Vista SP1 and Windows Server 2008 does not ship with the MIME Types registered for file types used by Silverlight applications. This also mean’s older web servers running IIS6 will also need the correct MIME Types configured for a Silverlight application to work correctly.

These are the MIME Types needed for Silverlight Applications to function properly:

  • .xap     application/x-silverlight-app
  • .xaml    application/xaml+xml
  • .xbap    application/x-ms-xbap

In IIS7 registering MIME Types can be done either via the IIS Manager console (GUI) or editing the: %windir%system32inetsrvconfigapplicationHost.config file under the <staticContent> section. In IIS6 you can use the IIS6.0 Console or script the changes.

Luckily I wrote a small VBS Script to automatically register the correct MIME Types for an IIS7-based web server. The script wont work on IIS6, you will need to do it manually. You can either Run the script directly by clicking it below, or Save Target as by right-clicking the link and saving it to run later.

If you need some help to manually register MIME Types in IIS7 or IIS6 you can follow this article: http://learn.iis.net/page.aspx/262/silverlight/

Rating 3.00 out of 5

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top