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