BT

InfoQ Homepage News Looking inside Silverlight XAP Files, and Making Them Smaller

Looking inside Silverlight XAP Files, and Making Them Smaller

Bookmarks

The unit of deployment in Silverlight is a XAP file. This file contains the manifest and all of the code necessary to run a Silverlight application. The file format itself is nothing special, it is just a ZIP file with a different name. Inside it you can find an AppManifest.xaml file and any necessary DLLs.

Unfortunately, the included DLLs often contain a lot of unnecessary code. If your application only needs a small part of a library, your download size could be unnecessary large. Rather than using a new project file for each application, you can remove the unused classes after the fact using XapOptimizer.

XapOptimizer, currently in beta, is an online tool from ComponentOne. You can upload XAP files, which are purged of unnecessary code and then emailed back to you. For the purpose of this article I grabbed a couple of random XAP files I had in my web browser cache and got back an average reduction of 27%. Checking with Reflector, it did in fact strip out several types from the DLLs.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.