你如何强迫Firefox不缓存或重新下载Silverlight XAP文件? [英] How do you force Firefox to not cache or re-download a Silverlight XAP file?

查看:163
本文介绍了你如何强迫Firefox不缓存或重新下载Silverlight XAP文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用Silverlight的时候,我注意到Firefox会缓存XAP文件,所以如果我做了一个更新,用户可能会使用过时的版本。有没有办法强制浏览器每次重新下载XAP文件,或者只是在更新发布后强制执行?或者在Silverlight配置中有一个设置可以阻止浏览器缓存XAP文件?



谢谢,
jeff


查询字符串完美地工作,但我不会使用 DateTime.Now ,因为它强制用户重新下载应用程序每次。相反,我们使用下面的代码:

pre $ protected $ page_oad(object sender,EventArgs e)
{
var versionNumber = Assembly.GetExecutingAssembly()。GetName()。Version.ToString();
this.myApp.Source + =? + versionNumber;



$ b $ p
$ b

这样你所要做的就是增加 AssemblyInfo.cs 文件。


When working with Silverlight, I've noticed that Firefox will cache the XAP file, so if I do an update, a user may be stuck using an outdated version. Is there a way to force the browser to either re-download the XAP file every time, or maybe only force it to after an update has been published? Or is there a setting in the Silverlight config that stops the browser from caching the XAP file altogether?

Thanks, jeff

解决方案

The query string works perfectly, but I wouldn't use DateTime.Now, because it forces the user to re-download the app every time. Instead, we use the following:

protected void Page_Load(object sender, EventArgs e)
{
    var versionNumber = Assembly.GetExecutingAssembly().GetName().Version.ToString();
    this.myApp.Source += "?" + versionNumber;
}

This way all you have to do is increment the version number in the AssemblyInfo.cs file.

这篇关于你如何强迫Firefox不缓存或重新下载Silverlight XAP文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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