Mysteries of Silverlight Deployment – Error Code 2104 – Could not download the Silverlight application

So I’m trying to open a newly deployed Silverlight site/app in my browser.  I have the latest version of Silverlight, the files are deployed, the security is configured.  Still, one of my Silverlight apps is downloading to the browser properly, the other one, gives me the following error:

Error: Unhandled Error in Silverlight Application
Code:  2104
Category: InitializeError
Message:  Could not download the Silverlight application.  Check web server settings

I checked the web.config.  Nothing different between the site that works and the one that doesn’t.

I checked a bunch of other things.  Nada.

I finally broke down and started a tab-by-tab comparison of the Web Site Properties dialog in IIS Manager.  (IIS 6.0)  On the HTTP Headers tab, everything matched.  Then I clicked on the MIME Types… button, and there was my discrepancy.

In order for IIS 6 to serve up a Silverlight App, you have to add the following MIME Types to the Web App Properties, HTTP Headers tab:

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

After adding these entries, I had to click OK a couple of times to get back to IIS Manager and save the change.  Then I had to close and re-open my browser because IE likes to cache everything so even a refresh didn’t download the Silverlight app.  Once I re-opened, the Silverlight app loaded, and I was back to debugging.  Yay.

One thought on “Mysteries of Silverlight Deployment – Error Code 2104 – Could not download the Silverlight application

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s