ComponentOne XapOptimizer is a utility that optimizes Silverlight applications by making XAP files smaller and more difficult to reverse engineer.
Reducing application size is always a good thing because small applications load faster and are easier to distribute and install. This is especially important in Internet scenarios, where applications are deployed as part of Web pages and are constantly downloaded and updated.
Preventing reverse engineering is also a common concern, especially for .NET applications which are easy to disassemble using popular tools such as the Red Gate .NET Reflector.
ComponentOne XapOptimizer accomplishes these optimizations using two techniques:
• Pruning: Pruning (also known as dead-code elimination) consists of
analyzing the application and removing classes and resources that are not used.
Dead code is common in applications that use libraries. Libraries typically
include many controls and classes of which each client application only uses
small subsets.
For example, if your application uses a C1HyperPanel,
then it needs a reference to the C1.Silverlight.dll assembly, which
contains the C1HyperPanel as well as many other controls your application
does not use or need. In this case, XapOptimizer will create a new
version of the C1.Silverlight.dll assembly that contains only the
C1HyperPanel class and its dependencies.
ComponentOne XapOptimizer will also remove unused resources (Styles, Templates, Brushes, and so on) defined in resource dictionaries in XAML files. ComponentOne XapOptimizer supports merged dictionaries now as well.
• Obfuscation: Obfuscation consists of changing the names of classes
and fields in order to deter reverse engineering. This process also reduces the
size of assemblies by using obfuscated names that are shorter than the original
names.
For example, if your application has a public class called
PasswordManager, the XapOptimizer obfuscator will rename that
class to something more like x. This makes the new assembly smaller and
harder to understand for anyone who opens it in a disassembler.