Prevent Silverlight XAP file from caching in your browser.
Posted by Viral Sarvaiya on January 19, 2012
Sometime when we deploy silverlight project, that happen often that when you run website it run older deploy project. because that comes from the cache,
so clear the cache of the Browser and some time that problem occur also after clearing cache.
so for that we have to force website to download new version of xap file every time when it run.
normally we have tag for XAP file, as like below
<param name="source" value="/ClientBin/SilverApp.xap" />
but we have to download our XAP file new at every run of site.
so there so many option for that.
1) changing the Assembly and File version numbers
2) GUID value for the project
but, here is the simple and best solution for that and then it worked like a charm everytime.
<param name="source" value="/ClientBin/SilverApp.xap?ignoreme=<%=System.DateTime.Now.ToUniversalTime()%>" />