Search code examples
silverlightmedia

Reducing .XAP file size?


I created a customized version of the Silverlight Player. After building/compiling, the .XAP which gets pushed out, it ends up being over 700KB.

I'm not too sure why it's doing this because I'm not adding any new resources. All my changes have all been in the code.

Is there any way to reduce the file size?


Solution

  • You are probably including DLLs you did not intend to. The Copy Local option for DLL references you add is True by default.

    A XAP file is just a ZIP file with a different extension so the first thing to do is unzip it and take a look at what is included.

    You can use a better Zip program to recompress the XAP file, but that will only gain you another 10%-20% at best.

    If it turns out you are really just concerned about initial load time vs. total load time you can load an initial (small) bootstrapper to update the display while loading subsequent modules dynamically (look at PRISM and MEF).