Silverlight 3的脱离浏览器的更新
-
12-09-2019 - |
题
我正在使用时,一个新的版本发布未recieving更新一个Silverlight应用程序的几个用户。是不是这个假设是自动的或者是我的地方缺少一个选项?我也开始觉得,也许XAP文件被缓存和我的一些需要如何防止这一点。
任何思考了吗?
解决方案
您需要编写的几行代码。
如果你熟悉“点击”部署,然后一些你用来做什么的选项不是在Silverlight中存在。你需要自己编写的代码。
HTTP://nerddawg.blogspot。 COM / 2009/07 / Silverlight的外的浏览器的应用程序-how.html
private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new MainPage();
if (Application.Current.IsRunningOutOfBrowser)
{
Application.Current.CheckAndDownloadUpdateAsync();
}
和然后在App()
构造:
Application.Current.CheckAndDownloadUpdateCompleted +=
new CheckAndDownloadUpdateCompletedEventHandler(Current_CheckAndDownloadUpdateCompleted);
和一个事件处理程序:
void Current_CheckAndDownloadUpdateCompleted(object sender, CheckAndDownloadUpdateCompletedEventArgs e)
{
// http://nerddawg.blogspot.com/2009/07/silverlight-out-of-browser-apps-how.html
if (e.UpdateAvailable)
{
MessageBox.Show("The application has been updated! Please close and reopen it to load the new version.");
}
else if (e.Error != null && e.Error is PlatformNotSupportedException)
{
MessageBox.Show("An application update is available, " +
"but it requires a new version of Silverlight. " +
"Please contact tech support for further instructions.");
}
}
其他提示
有仅当显影剂执行CheckAndDownloadUpdateAsync()调用自动更新。见更新:的 http://timheuer.com/blog/archive/2009/07/10/silverlight-3-released-what-is-new-and-changed.aspx#oob
不隶属于 StackOverflow