Silverlight发布中的问题 [英] problem in Silverlight publish

查看:54
本文介绍了Silverlight发布中的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在母版页内容上有一个silverlight 2.0对象.我在本地看到它,但是发布后在主机上看不到它.根据Microsoft博客,我添加了2个MIME类型的xaml和xap,但未显示silverlight对象.我看不到silverlight对象的内容,但是我可以通过右键单击来配置silverlight.请引导我.

I have a silverlight 2.0 object on content of masterpage. i see it on local but can't see on the host after publishing. according to Microsoft blog i add 2 MIME type of xaml and xap but silverlight object doesn't appear. i can't see the content of silverlight object but i can configure silverlight by right click. please guide me.

推荐答案

如果您可以右键单击并获得Silverlight菜单,则您的 object 标签显然可以正常显示,这是一个好的开始.

If you can right-click and get the Silverlight menu, your object tag is obviously rendering OK, which is a good start.

您没有提及是否看到加载百分比"蓝点动画?如果出现,则表明插件正在加载您的XAP文件-但是,如果您看不到看到加载动画,则可能是获取" XAP文件本身存在问题.常见的原因有两个:

You don't mention whether you see the "percent loading" blue-dot animation? If that appears then the plugin is loading your XAP file - BUT if you don't see the loading animation it's likely that there is a problem "getting" the XAP file itself. There are two common reasons:

1)服务器将不提供XAP文件.这实际上非常普遍,因为默认情况下IIS不会提供未知的文件扩展名,对于许多托管服务提供商,此文件包括 .XAP .检查这非常容易:只需将XAP的路径放在浏览器中,然后尝试下载它即可. http://racereplay.net/ClientBin/Silverlight2.xap 应弹出下载此文件"对话框.

1) The server won't serve XAP files. This is actually quite common as by default IIS won't serve unknown file extensions, and for many hosting providers this includes .XAP. Checking this is very easy: just put the path to your XAP in the browser and try to download it... eg. http://racereplay.net/ClientBin/Silverlight2.xap should pop-up a "Download this file" dialog.

如果您获得 找不到404页面 ,则此这就是为什么您的页面无法正常工作的原因.

IF you get a 404 Page Not Found then this is why your page isn't working.

在这种情况下,解决方法是(i)更新IIS设置(您说您已经设置了MIME类型,因此只需检查它们是否正确),或者(ii)重命名您的 .XAP .ZIP (文件本身和< object> 标记中).大多数服务器的ZIP文件都没有问题,Silverlight也不介意.

The fix in this case is either (i) update the IIS settings (you say you've setup the MIME types already, so just check they are correct) OR (ii) RENAME your .XAP to .ZIP (both the file itself AND in the <object> tag). Most servers have no problem with ZIP files, and Silverlight doesn't mind either.

2) XAP的路径可能错误.仔细检查路径是否正确,例如在此示例中

2) The path to the XAP might be wrong. Double-check that the path is correct, say for this example

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="../ClientBin/Silverlight2.xap"/>

如果以上标记位于 http://racereplay.net/SmhHalf/default.aspx ......,请将XAP路径(源)复制到URL上,并验证是否提示您下载文件,例如 http://racereplay.net/SmhHalf/../ClientBin/Silverlight2.xap

if the above tag is at http://racereplay.net/SmhHalf/default.aspx... copy the XAP path (source) onto the URL and verify that you get prompted to download the file, eg http://racereplay.net/SmhHalf/../ClientBin/Silverlight2.xap

在这种情况下,解决方法只是使路径正确.您提到< object> 标记位于母版页上,因此您可能需要一个绝对路径(例如"/ClientBin/Your.XAP"),因为我猜想您的母版页可能会用在/default.aspx 以及站点的任何子目录中(/AboutUs/Help.aspx 或其他任何内容).

The fix in this case is simply to get the path right. You mention the <object> tag is on a Masterpage, so you'll probably want an absolute path (eg. "/ClientBin/Your.XAP") because I guess your Masterpage could be used in /default.aspx and also in any subdirectory on your site (/AboutUs/Help.aspx or whatever).

正如安东尼所说,服务器上的软件无关紧要(除了允许下载 .XAP 文件的Web服务器),因此不必担心那里的.NET版本.

As Anthony said, the software on the server is irrelevant (except for the web server allowing .XAP files to be downloaded), so don't worry about .NET versions there.

如果您在尝试这些建议(或者可能是实际的URL本身)时更新自己的信息,其他人可能会提供更多建议.

If you update your post as you try these suggestions (and perhaps the actual URLs themselves) others may be able to offer more advice.

这篇关于Silverlight发布中的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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