BT

Looking inside Silverlight XAP Files, and Making Them Smaller

by Jonathan Allen on Mar 04, 2009 |

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.

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.

Tell us what you think

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

Email me replies to any of my messages in this thread
Community comments

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

Email me replies to any of my messages in this thread

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

Email me replies to any of my messages in this thread

Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT