Posted 1 November 2008 Tweet
If you host XAP files on a CDN or other host (such as Amazon S3), you need to have the server configured with the new Silverlight MIME type. You can find out specifics in the breaking changes reference.
When you do not need to configure the MIME type:
But, if you want to share or enable embedding for others, you need to add the "application/x-silverlight-app" MIME type for your .Xap files.
This will allow:
Equally important, if you don't want others to directly link to and reference your .Xap from their domains, then make sure to not send this mime type.
For global configuration, in your central mime.types file, add:
# Enable Silverlight support for our apps to be embedded anywhere
Then restart Apache:
$ sudo ./apachectl restart
If you're just configuring at the directory level, edit or add the .htaccess file in the directory you want to serve anywhere, and add the line:
AddType application/x-silverlight-app xap
IIS 6 & 7
Here's a nice step-by-step guide to adding the MIME type on Windows web servers.
Maybe not a true CDN, I do use Amazon's Simple Storage Service (S3) for most of my Silverlight application hosting.
Amazon S3 records the MIME type that your S3 client sends with each file upload. This means that you must configure your system with the appropriate "application/x-silverlight-app" MIME type when you upload, or when clients download your .Xap, they will get an unknown MIME type and be greeted with blank space where you'd expect your app to be working.
I'd highly recommend that you download and use Fiddler2 on your Windows system. Using it, you can make sure and see what the content type is when it comes back in an HTTP response.
Jeff Wilcox is a software development engineer at Microsoft who leads exciting open source projects on the Windows Azure team. Jeff has been at Microsoft 8 years and is an alumnus of the University of Michigan.
Jeff leads the open source Windows Azure SDK and cross-platform command line tools development team at Microsoft. Offering tooling for OS X, Windows and Linux and SDKs for Node.js, Java, .NET, PHP, Python; the work is open source, licensed under the Apache 2 license.
4th & Mayor is the top-rated social app on the Windows Phone Store with thousands of five star reviews. The best foursquare experience for Windows Phone, it is powered by a Node.js backend running on Windows Azure & Amazon Web Services. Jeff Wilcox is the developer of the app.