[Silverlight getting started series] How does prism reduce the xap file size of the module to improve performance?

Source: Internet
Author: User

Silverlight applications built with prism often have many modules. Each module can be an xap or all modules can be an xap. For details about the splitting method, see the post on msdn. Let's take a look at the compiled xap file in the clientbin directory, that is, the file to be downloaded to the client. Open this xap file with any compressed file such as WinRAR or 7z. You can see:

Sometimes you can see the readme.txt file in your project! Okay. Now we will slim down the xap file and reduce its size:


1. put all system. windows. ****. the DLL property copylocal = false, provided that the DLL has been referenced in the shell, otherwise it will run and an error will be reported.




2. Set the property buildaction = none for all images/* image files, and write a postbuild script to automatically copy the image file to the web project path.The specific implementation method has been described in detail in my previous blog. In this way, your image will not appear in the xap file, nor be packaged into the Assembly with embedded resources. Note that in XAML, the image reference path cannot be used as a resource. Refer to my previous blog.


3. Set the buildaction = none attribute of all readme.txt files that you do not want to put into the xap file.


4. Use the class library cache. For details, refer to msdnThisPost.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.