Using Images in Silverlight project = large XAP size

Using images in Silverlight project can cause serious problem of very large XAP size thus increased page load time. All images references in any Silverlight project are compiled and included into dll in XAP file.

If you look inside XAP file as mentioned in my post What is inside a XAP file, you will not find any image. Let’s investigate this. First take a note of your XAP size and then include a few heavy images in your Silverlight project and build the project. Now observe the size of XAP. Isn’t that increased? Notice the increased size of project’s dll inside the XAP. The images are compiled and included in project’s dll.

Thus avoid using images in your Silverlight project instead keep images on server and use them by creating bitmap from the image URI.

You can further optimize performance of your Silverlight application by referring to this and this link.

This entry was posted in Knowledge Sharing, Silverlight, Troubleshooting. Bookmark the permalink.

Leave a Reply