Silverlight or Sketchflow error 2104 unable to download the application with IIS
Any time you receive a blank web page when trying to view or deploy a Silverlight application to your web server, it is possibly the result of a missing .xap MIME type handler. Occasionally it has to do with file permissions, if you just created a new web site and directory. Back in early 2008 when I first started working with Silverlight, it was difficult to find information about why the Silverlight app wouldn't display. If I remember correctly, Visual Studio at that time did not generate the Javascript code in the HTML app page to bubble up the error in Silverlight 2 so there was no indication. The first place that you should check when you have a strange issue with a web page hosted on IIS is to examine the web site access logs. The logs should give you an indication of whether it is file access permissions, authentication problems, or (in this case) missing mime type mappings.
Here in the access log you can see the xap file error:
2009-10-15 08:54:08 W3SVC1512438873 192.1681.1.22 GET /WebAdmin/WebAdmin.xap - 80 - 192.168.1.44 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.0.14)+Gecko/2009082707+Firefox/3.0.14+(.NET+CLR+3.5.30729) 404 3 50
For IIS, you can find the detailed explanation of IIS HTTP status codes listed here:
http://support.microsoft.com/default.aspx/kb/318380
If you skip to the 404 error in the reference documentation, you will see that 404.3 means "MIME map policy prevents this request"
I describe how to find the error in javascript Internet Explorer below... but in FireFox you would need to use the Tools menu to open the Error Console and scroll to the end to find the javascript error.
When you navigate your web browser to the page in IE, you are greeted with a blank web page and the only indication of a problem (on IE) is the little javascript error icon in the bottom left corner of the browser as seen here:
Double clicking on the icon shows the following error:
Right click on the website in IIS select Properties, and click on the HTTP Headers tab:
click on MIME Types... click New.. and enter ".xap" for Extension and "application/x-silverlight-app" as the MIME-Type:
The older .xaml is for Silverlight 1 and .xbap is for WAML Browser Application for WPF deployments. If you want xbap add a similar entry with "application/x-ms-xbap". For more info on XBAP go here: http://xbap.org/
For anyone hosting on an asp.net web host provider like GoDaddy or DiscountASP, you can configure the mappings yourself in web.config. Here is an article that has tips on web hosting with Silverlight: http://www.wpflearningexperience.com/?cat=12
This article contains information about setting the mime types using web.config:
http://blogs.iis.net/bills/archive/2008/03/25/how-to-add-mime-types-with-iis7-web-config.aspx