任何看到FireFox和Chrome的Silverlight Devs都会提示安装SL Runtime,但是IE8还不错?我正在使用Silverlight 4 Developer运行时。
答案 0 :(得分:2)
我已经看到当aspx页面出现问题时会发生这种情况。
当我的一个initParameters没有设置值时,就像你描述的那样,它发生在我身上。
在下面的代码示例中,请注意名为“initParms”的参数。它有值=“虚拟”。如果要删除它,则会出现与您描述的错误相同的错误。
<body>
<form id="form1" runat="server" style="height: 100%">
<div id="silverlightControlHost">
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
width="500" height="74">
<%-- <param name="source" value="ClientBin/<app>.xap" />--%>
<%
string orgSourceValue = @"ClientBin/<app>.xap";
string param;
if (System.Diagnostics.Debugger.IsAttached)
param = "<param name=\"source\" value=\"" + orgSourceValue + "\" />";
else
{
string xappath = HttpContext.Current.Server.MapPath(@"") + @"\" + orgSourceValue;
DateTime xapCreationDate = System.IO.File.GetLastWriteTime(xappath);
param = "<param name=\"source\" value=\"" + orgSourceValue + "?ignore="
+ xapCreationDate.ToString() + "\" />";
}
Response.Write(param);
%>
<param name="onError" value="onSilverlightError" />
<param name="windowless" value="true" />
<param name="background" value="white" />
<param name="enablehtmlaccess" value="true" />
<param name="minRuntimeVersion" value="4.0.50401.0" />
<param name="uiculture" value="<%= System.Threading.Thread.CurrentThread.CurrentUICulture %>" />
<param name="culture" value="<%= System.Threading.Thread.CurrentThread.CurrentCulture %>" />
<%-- <param name="autoUpgrade" value="true" />--%>
<!-- add these parameters to get a splash screen to display -->
<param name="splashscreensource" value="ClientBin/splash_spinner.xaml" />
<param name="onSourceDownloadProgressChanged" value="onSourceDownloadProgressChanged" />
<!-- add these parameters to display to Silvelight installation/upgrade instructions -->
<param name="onUpgradeRequired" value="onUpgradeRequired" />
<param name="onInstallRequired" value="onInstallRequired" />
<param name="onRestartRequired" value="onRestartRequired" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50401.0" style="text-decoration: none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight"
style="border-style: none" />
</a>
<param name="initParams" runat="server" id="prmInitParams" value="dummy=" />
</object>
<iframe id="_sl_historyFrame" style="visibility: hidden; height: 0px; width: 0px;
border: 0px"></iframe>
</div>
<div id="unsupported">
</div>
</form>