views:

1156

answers:

4

I am trying to create a "Hello world" application in Silverlight 3.0, but when it runs, there is an error: (IE 8)

Error:

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

When the project was created I chose to host the Silverlight application in a new web site (ASP.net web application project )

Here is my code:

<UserControl x:Class="Test.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
  <Grid x:Name="LayoutRoot">
    <TextBlock Text="Hello World!"/>
</Grid>
</UserControl>

I also have tried to run in Firefox, it does not work there either.

Does anybody know how to fix this?

A: 

Check url of your SL application file. Looks like its unable to download it.

Ray
+1  A: 

The MIME types on your webserver are not setup correctly to host your silver light application. The MIME types needed are:

.xaml    application/xaml+xml 
 .xap    application/x-silverlight-app 
 .xbap    application/x-ms-xbap
GustlyWind
How can I add the MIME types to the ASP.NET development server running from VS 2008?
eflles
Install the Silverlight Tools they'll set it up correctly.
Graeme Bradbury
+1  A: 

By not hosting it in a new ASP.NET application project, the error did not show.

eflles