views:

22

answers:

1

Hi guys,

I get the following error after moving aspx page to some folder.

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

Environment: Win7 x64, VS2010, SL 4.0.50524.0, IE8, IIS7.5

Steps to reproduce:

  1. In VS 2010 create a new Silverlight Application (target .NET Framework 4.0).

  2. Host the Silverlight application (Silverlight version 4.0) in a new Web site (Web application project).

  3. Runs SilverlightApplication.web project, where the starting page is SilverlightApplicationTestPage.aspx
  4. Application run successful without any error.
  5. In VS2010, create a new folder with name Test under SilverlightApplication.web project and move the SilverlightApplicationTestPage.aspx page to it.

    SilverlightApplication.web -- Test -- SilverlightApplicationTestPage.aspx

  6. In the SilverlightApplication.web project change the path to the starting page refer to the moved pageSilverlightApplicationTestPage.aspx (Properties -> Web tab -> Start Action -> Specific Page = Test/SilverlightApplication5TestPage.aspx)
  7. Runs SilverlightApplication.web project again.

Result: The above JS error appears.

I have checked the MIME types (xaml, xap and etc.) in my IIS. They are present. I can successfully access directly to the SilverlightApplication.xap file.

Do you have any idea what I'm doing wrong?

Maybe I should change some additional settings after moving asp page that host Silverlight control?

A: 

I got the same result when following your instructions. The problem is the following line in your aspx page:

<param name="source" value="ClientBin/TestOnly.xap"/>

The page is trying to load the XAP file from a directory called ClientBin under your test directory. Change the line to this:

<param name="source" value="/ClientBin/TestOnly.xap"/>

Now the path will start at the root of the web site. I also noticed this line in the aspx page:

<script type="text/javascript" src="Silverlight.js"></script>

This won't load correctly either for the same reason. I changed the line to:

<script type="text/javascript" src="/Silverlight.js"></script>
DaveB
Hi Dave,Thanks. That was the cause of my issue. After adding the "/" character to value and scr attribute the issue gas been resolved.Best Regards, Oleg
Oleg Burov