Welcome to MSDN Blogs Sign in | Join | Help

Mike Ormond's Blog

In my world, things would be simpler than this...

News

  • Add to Technorati Favorites

    These postings are provided "AS IS" with no warranties, and confer no rights. The use of any script / code samples is subject to the terms specified here.

Silverlight 1.1 Projects Running From Filesystem

I've seen the same question a few times now about how you can create a Silverlight 1.1 project that doesn't run from the filesystem. By default, when you create a Silverlight 1.1 project in Visual Studio 2008 and hit F5 (run), IE will fire up with a filesystem URL as below (ie your page isn't being served by a webserver).

image

So what if I want to make use of webservices or the downloader object? You need to get your Silverlight 1.1 app running in the context of a website...

  • imageAdd 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

image

 

 

 

 

 

Technorati Tags:
Posted: Tuesday, August 21, 2007 11:33 AM by MikeOrmond
Filed under:

Comments

Chris Hay said:

On a seperate but similar point :)

I've posted an article on my blog which covers if you want to be able to develop something which does run under file system mode (but also equally capable of running in online mode, and in that case use the downloader object).

http://silverlightuk.blogspot.com/2007/08/silverlight-downloader-which-works-both.html

# August 21, 2007 9:05 AM

Mark Johnston's Developer Experiences said:

I've been umming and ahhing about what to do with this now that I have changed roles and no longer getting

# August 21, 2007 3:41 PM

Noticias externas said:

I've been umming and ahhing about what to do with this now that I have changed roles and no longer

# August 21, 2007 4:19 PM

WynApse said:

Silverlight Cream for August 22, 2007 - Part 2

# August 22, 2007 7:28 PM

Liam Molloy said:

Great tip Mike!

Cheers, Liam

# September 19, 2007 6:22 PM
New Comments to this post are disabled
Page view tracker