Reducing XAP size of Silverlight Client apps

In this article I would like to share my experience related to the hosting of Silverlight Chat applications on real production servers and accessing it over internet.

I developed a Silverlight chat application based on Silverlight 5 and ASP.Net that’s works perfectly and runs smoothly but sometimes take some time to download and load a Chat Panel (that was based on Silverlight) which seems quite notorious. After doing some R&D I came to know that with simple configuration from Visual Studio on your project settings page you can compress the XAP file size and make your life easier.

As in the project I used Telerik and AJAX toolkit controls and some of the assembly sizes were big which takes some time to load the Silverlight application on client side. As by default, the XAP file embedded all the assemblies in itself. But you can change that option by “Reduce XAP size by using application library caching” option from Project properties of your Silverlight project.

By doing this a compressed version of all the assemblies downloaded on client side and cached and next time if you reload the application it will not download all the assemblies again but used the cached version.

When you enable this check all the assemblies that are referenced in the Silverlight project got compressed and added in the ClientBin folder.

After doing this, when I checked the XAP file size I got really happy.

Before compression

After compression


1 thought on “Reducing XAP size of Silverlight Client apps

  1. Hey,
    This is simply superb. I was able to reduce my XAP file from 4.5MB to 1.12MB. Which is awesome.

    But i get “Couldnot download the silverlight application” error.
    Can you help me out ?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s