If you have a Silverlight application (framework 3.0 or superior) which the XAP file is sizable and the application has performance problems, you should put the project references in separate files using application library caching.

You can follow this MSDN article that explains all that you need to implement Silverlight application library caching.

Basically, the Silverlight packages specifies assemblies as external parts of the application package (a zip file that contains the assembly dll). Then, it will download all of the required package parts specified on application manifest.

To do this, you just need to create a xml file named <assembly name without extension>.extmap.xml. It must have content similar like this:

<?xml version="1.0"?>

<manifest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

          xmlns:xsd="http://www.w3.org/2001/XMLSchema">

  <assembly>

    <name>System.Json</name>

    <version>2.0.5.0</version>

    <publickeytoken>31bf3856ad364e35</publickeytoken>

    <relpath>System.Json.dll</relpath>

    <extension downloadUri="System.Json.zip" />

  </assembly>

</manifest>

File Elements Description:

  • name – Assembly name
  • version – Assembly version
  • publickeytoken – Key token which you used to sign the assembly.
  • relpath – Assembly file name.
  • extension – Uri where it’s possible to download the assembly package.

Note: You cannot use the application library caching on out-of-browser applications.

LEAVE A REPLY

Please enter your comment!
Please enter your name here