revised:
Monday, May 19, 2008
To run a Silverlight 2 application the server has to be configured to serve .XAP files. The MIME type must be set-up.
The important thing is to verify that files with the .xap file extension will be served by the web server. Otherwise you will most likely see
a blank (white or whatever your background color in the object-tag is) area where you expect your Silverlight Application.
If you are not sure if your server has the XAP mime type set-up or you can't influence that (e.g. because your provider doesn't allow that)
then you could go with a work-around:
change the xap extension to .zip
The .ZIP alternative
Rename the .xap file extension of your application to .xap.zip and by doing that the server thinks it handles a zip MIME type.
In my example I kept the .xap in the file name but you can certainly leave that away.
A .xap file is anyway a zip-file and therefore you can also use any unzip utility to check what is inside that xap package.
If you do not need the work-around then please see
following information on how to set-up the MIME type for IIS:
Configuring IIS for Silverlight Applications
(Please check the article "Configuring IIS for Silverlight Applications" for latest information, see web link:
http://learn.iis.net/page.aspx/262/silverlight/)
If above link has changed its content or has moved then see following excerpt:
MIME Types
In Windows Server 2008 IIS 7.0 :
All MIME types needed to support Silverlight are implemented by default in Windows Server 2008 IIS 7.0 and Windows Vista SP1.
Windows Vista RTM customers
can add mime types by running "IIS Manager", clicking on "Mime Types", then clicking "add" and adding the following mime types:
.xap application/x-silverlight-app
.xaml application/xaml+xml
.xbap application/x-ms-xbap
Alternatively, you can add the following mime types to your %windir%\system32\inetsrv\config\applicationHost.config file in the
section.
<mimeMap fileExtension=".xaml" mimeType="application/xaml+xml" />
<mimeMap fileExtension=".xap" mimeType="application/x-silverlight-app" />
<mimeMap fileExtension=".xbap" mimeType="application/x-ms-xbap" />
In Windows Server 2003 IIS 6.0
To enable IIS 6.0 in Windows Server 2003 or IIS7 in Windows Vista RTM with the appropriate MIME Types, add:
.xap application/x-silverlight-app
.xaml application/xaml+xml
.xbap application/x-ms-xbap
In other web servers like Apache, lighttpd, you should also be able to run the Silverlight application if you allow access to .xaml, .wmv and .xap files.