强制浏览器在更新后重新加载Silverlight xap
我有一个Silverlight控件打包并部署到SharePoint Web部件。在我推动更新后,浏览器加载新版本的控件时遇到问题。我正在更新我的xap项目的汇编和文件版本,但似乎并不重要。让浏览器加载新的xap的唯一方法是进入并删除临时Internet文件。对于我来说,在开发过程中,没关系,但是在生产之前我需要找到一个解决方案。任何想法?
I have a Silverlight control packaged up and deployed to a SharePoint web part. I'm having trouble with the browser loading new versions of the control after I push an update. I'm updating the assembly and file version of my xap project, but it doesn't seem to matter. The only way to get the browser to load the new xap is to go in and delete temporary Internet files. For me, during development, that's OK, but I'll need to find a solution before it's time for production. Any ideas?
这与浏览器处理资源请求的方式有关。 Flash有类似的问题,有几种解决方法。
This has to do with how your browser handles resource requests. Flash has similar issues and there are a couple workarounds.
这是一个文章,详细说明问题和可能的解决方案。
Here's an article that details the issue and possible solutions.
我建议这样做:
说你在你的html中有这个xap:
Say you have this for your xap in your html:
<param name="source" value="ClientBin/myApp.xap"/>
我会版本,所以每当你推一下你更改版本号。示例:
I would version it so whenever you do a push you change the version number. Example:
<param name="source" value="ClientBin/myApp.xap?ver=1"/>