Silverlight 1.1 - Downloader and Visual Studio 2008
This week I lost my Silverlight virginity. I have been working on a pet project in my spare time with the aim of finally getting up to speed on Silverlight. One thing I found out about is the downloader object. This object lets you load up a set of media in a zip file which can then be used within your application. However when running your application it needs to be run in the context of a web application for the downloader to work. The problem is when you create a silverlight application in Visual Studio 2008 and run it in debug mode it is run within the context of the file system. I googled this issue and found a great blog post titled “Sillverlight 1.1. Projects Running From FileSystem” by Mike Ormond. This blog post lists the following steps:
Add a new website to your solution
Add a "Silverlight Link" (right click the website and select "Add Silverlight Link..." - see left)
I suggest you enable Silverlight debugging when prompted. Otherwise you can enable it later from the website properties (see left below)
The act of adding the Silverlight link will copy your XAML and Silverlight assembly to the website project and re-copy these each time you build
Copy Silverlight.js and your html / html.js files from your Silverlight project to the website
You should now be able to run your Silverlight app from the website project either by setting the html page as the default or right-clicking and selecting "View in Browser" in the usual way
I tested this out and it works. Cheers Mike!