Sunday, October 11, 2009

Silverlight 3 Could Not download the silverlight Application

I created a simple Silverlight 3 app.

<UserControl x:Class="SilverlightApplication2.MainPage"
    mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
    <Grid x:Name="LayoutRoot">
        <TextBlock Text="Hello World!" ></TextBlock>

When I run it I get an error about not being able to download the silverlight app

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

Well if you look in the ClientBin folder you will see it is empty so the xap file is not available to be used

To fix this right click on the web application and select Build Order.  On the Dependencies tab make sure the Checkbox next to the Silverlight app is checked.