Silverlight 3 浏览器外更新

发布于 2024-08-01 18:05:46 字数 133 浏览 3 评论 0原文

我有一些正在使用 silverlight 应用程序的用户,但在发布新版本时没有收到更新。 这不是应该是自动的还是我在某个地方缺少一个选项? 我也开始认为 XAP 文件可能被缓存了,我知道如何防止这种情况发生。

有什么想法吗?

I have a few users that are using a silverlight app that aren't recieving updates when a new release is published. Isn't this suppose to be automatic or perhaps I'm missing an option somewhere? I was also starting to think that maybe the XAP file is cached and I some how need to prevent that.

Any thoughts out there?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

帥小哥 2024-08-08 18:05:46

仅当开发人员执行 CheckAndDownloadUpdateAsync() 调用时,它才会自动更新。 查看更新:http://timheuer.com/blog/archive/2009/07/10/silverlight-3-released-what-is-new-and-changed.aspx#oob

It only auto updates if the developer performs the CheckAndDownloadUpdateAsync() call. See updates: http://timheuer.com/blog/archive/2009/07/10/silverlight-3-released-what-is-new-and-changed.aspx#oob

忆悲凉 2024-08-08 18:05:46

您需要编写几行代码。

如果您熟悉“一键式”部署,那么您习惯的某些选项在 Silverlight 中并不存在。 您需要自己编写代码。

http://nerddawg.blogspot.com/2009 /07/silverlight-out-of-browser-apps-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.");
        }
    }

You need to write a few lines of code.

If you're familiar with 'one click' deployment then some of the options you're used to don't exist in Silverlight. You need to write the code yourself.

http://nerddawg.blogspot.com/2009/07/silverlight-out-of-browser-apps-how.html

    private void Application_Startup(object sender, StartupEventArgs e)
    {
        this.RootVisual = new MainPage();

        if (Application.Current.IsRunningOutOfBrowser)
        {
            Application.Current.CheckAndDownloadUpdateAsync();
        }

and then in your App() constructor :

    Application.Current.CheckAndDownloadUpdateCompleted += 
    new CheckAndDownloadUpdateCompletedEventHandler(Current_CheckAndDownloadUpdateCompleted);

and an event handler :

 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.");
        }
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文