silverlight - 浏览器外的 Silverlight 应用程序 - 如何设置自动更新?

标签 silverlight silverlight-3.0

我想知道如何设置我的 Silverlight 项目以启用浏览器外应用程序的自动更新。

我在 app.xaml.cs 中添加了一些代码(见下文),重建应用程序,安装为浏览器外,更改 asseblyinfo.cs 中的 versionionfo,重建,再次运行但不幸的是没有更新发生。我还缺少什么吗?

    public App()
    {
        this.Startup += this.Application_Startup;
        this.Exit += this.Application_Exit;
        this.UnhandledException += this.Application_UnhandledException;

        InitializeComponent();

        if (Application.Current.IsRunningOutOfBrowser)
        {
            App.Current.CheckAndDownloadUpdateCompleted +=
                new CheckAndDownloadUpdateCompletedEventHandler(App_CheckAndDownloadUpdateCompleted);
            App.Current.CheckAndDownloadUpdateAsync();
        }
    }

    void App_CheckAndDownloadUpdateCompleted(object sender, CheckAndDownloadUpdateCompletedEventArgs e)
    {
        if (e.Error == null && e.UpdateAvailable)
        {
            MessageBox.Show("Application updated, please restart to apply changes.");
        }
    }

编辑

奖励问题:

App如何检测到有更新?来自 assemblyinfo.cs? list 中的某处?

编辑

谁能解释为什么即使从桌面快捷方式运行应用程序,IsRunningOutOfBrowser 也总是返回 FALSE?

最佳答案

感谢 Silvelright 论坛,有一个解决方案。

IsOutOfBrowser 属性不能在构造函数中使用。它开始工作的时间是应用程序启动事件。

关于silverlight - 浏览器外的 Silverlight 应用程序 - 如何设置自动更新?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1920890/

相关文章:

c# - 是否有用于处理 Internet 上的大型数据集的设计模式?

silverlight - 无论如何要更改 Silverlight 3 中 OpenFileDialog 的标题?

silverlight - 寻求 Silverlight 应用程序的字体策略

Silverlight 3 滚动时的复选框列表框错误?

c# - INotifyPropertyChanged 绑定(bind)未按预期更新

silverlight - 修改 Silverlight 3 中新弹出控件 (ChildWindow) 的外观/行为

c# - 进行测验

c# - 计算 Property Changed MVVM 上两个值的结果

silverlight - WP7 : Suppressing XNA touch input when handled by Silverlight?

silverlight - 将转换器与 DependencyProperty 结合使用