Silverlight - Avoid caching in application library caching


Sometimes when I use Silverlight's library caching (project -> property -> Reduce XAP size by using application library caching) I need to change generated zip's file name to avoid caching of cached libraries. This may seems weird, but the goal is to force xap to re-download correct libraries when, for example, I change paramethers in some interface.
The standard method is to force user to clear browser's cache, but there is a smarter way to do this, using the extmap.xml file

In the real same path of your library's dll you need to place a file named  <library>.extmap.xml and write the downloadUri as following:

File: WankoSoft.Utils.Data.extmap.xml

<?xml version="1.0"?>
<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <assembly>
    <name>WankoSoft.Utils.Data</name>
    <version>2016.6.0.1050</version>
    <publickeytoken>7777aaa555b33cc1</publickeytoken>
    <relpath>
WankoSoft.Utils.Data.dll</relpath>
    <extension downloadUri="
WankoSoft.Utils.Data.2016601050.zip" />
  </assembly>
</manifest>


When Visual Studio will compile the xap, it will link the dll with the name you set on the <extension> tag.

And now, enjoy your no-cached caching! =)

Commenti

Post più popolari