views:

1023

answers:

2

I've just started getting this Javascript error running VS2010 with SL4

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

Everything was working fine, changed 1 line of code to use a RegularExpression in the web project (using the Silverlight Business Application template) then when rebuilding I get this error.

Google says this is IIS and mimetype related. I'm using Cassini not IIS with VS2010.

Rebooted, cleared xap from IE cache. Error on both IE and FF.

What could be wrong?

+1  A: 

I just got this error myself. Looking at source control and my project I noticed that the original test pages that were created when I setup the project got replaced by two new test pages (one .aspx and one .html).

I removed the newly created pages and went back to the old test pages and things started working.

If your situation isn't the same as mine, then just check your silverlightControlHost div in your test page and make sure you are pointing to the correct .xap file and runtime.

Keith Elder
It started working again. Not sure how though.
rotary_engine
+1  A: 

This error often occurs because the MIME type is not set, as you have found for yourself. It can also be a mask for the HTTP error. You can see the message by pulling up the XAP file directly from your browser (http://yourwebsite/ClientBin/filename.xap). The file will either attempt to download, or it will show you an HTTP Error.

Rachel Martin