Reduce XAP size

We may face to the problem that how to reduce the size of XAP file in Silverlight, there is the solution:

  1. Move to Silverlight project and right click, open property window, then check the option as below,
  2. Specify the reference path to a folder, e.g. ~/SharedLib/
  3. Add the XML format for each of your assemblies under SharedLib folder, e.g. System.Xml.Linq.dll
    1. create a new XML File named as : System.Xml.Linq.extmap.xml
    2. Fill this XML file with contents as below and save
<?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.Xml.Linq</name>
<version>2.0.5.0</version>
<publickeytoken>31bf3856ad364e35</publickeytoken>
<relpath>System.Xml.Linq.dll</relpath>
<extension downloadUri="System.Xml.Linq.zip" />
</assembly>
</manifest>

Finally, rebuild your application and then you will be able to find that all assemblies are built in serval .zip files under ClientBin folder.

posted @ 2012-02-05 21:25  C.Jun  阅读(209)  评论(0编辑  收藏  举报