移动aspx页面到某个文件夹code错误2104后 [英] Code error 2104 after moving aspx page to some folder

查看:203
本文介绍了移动aspx页面到某个文件夹code错误2104后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我感动aspx页面到某个文件夹后,收到以下错误。

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    

环境: Win7的X64,VS2010,SL 4.0.50524.0,IE8,IIS7.5

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

重现步骤:

  1. 在VS 2010中创建一个新的Silverlight 应用程序(目标.NET框架 4.0)。

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

主持人Silverlight应用程序(的Silverlight 4.0版)的新网站(Web应用程序项目)。

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

在VS2010中,创建下SilverlightApplication.web项目名称测试一个新的文件夹,移动SilverlightApplicationTestPage.aspx页面吧。

In VS2010, create a new folder with name Test under SilverlightApplication.web project and move the SilverlightApplicationTestPage.aspx page to it.

SilverlightApplication.web - 测试     - SilverlightApplicationTestPage.aspx

SilverlightApplication.web -- Test -- SilverlightApplicationTestPage.aspx

结果: 出现上面的JS错误。

Result: The above JS error appears.

我在IIS检查MIME类型(XAML,XAP等)。他们是present。 我可以成功地直接访问到的SilverlightApplication.xap文件。

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?

也许我应该移动承载Silverlight控件的ASP页面后更改了一些额外的设置?

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

推荐答案

我按照你的指令时,得到了同样的结果。问题是,在你的aspx页面下面一行:

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"/>

页面试图加载从一个叫的ClientBin test目录下目录的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"/>

现在的道路将开始在网站的根目录。我也注意到这条线在aspx页面:

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>

这篇关于移动aspx页面到某个文件夹code错误2104后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆