开发者

Reducing .XAP file size?

开发者 https://www.devze.com 2023-03-19 23:12 出处:网络
I created a customized version of the Silverlight Player. After building/compili开发者_运维技巧ng, the .XAP which gets pushed out, it ends up being over 700KB.

I created a customized version of the Silverlight Player. After building/compili开发者_运维技巧ng, 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?


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).


You can check the "Reduce XAP size by using application library caching" option.

By default any system dlls that your application uses will be included in the XAP file. By checking this option they are downloaded as separate zip files.

This won't reduce the total size of the files that your application downloads, but will mean that when you publish an update your users won't have to download all the system dlls again - they'll already have these in their local cache.

This option is primarily used in applications that are split across several XAP files to ensure that only one copy of the system dlls are downloaded for the whole application.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号