Pruning

Dotfuscator Professional Edition has the ability to statically analyze your application and determine which pieces are not actually being used. This includes searching for unused types, unused methods, and unused fields. This is of great benefit if application size is a concern, particularly if you are building your application from reusable components. Typically, not every type, method, and field is used in such applications. Dotfuscator can extract exactly the pieces you need for any given application, making it the absolute smallest it can be.

The static analysis works by traversing your code, starting at a set of methods called “triggers”. These are your application’s entry points. In general, any method that you expect external applications to call must be defined as a trigger. For example, in a simple standalone application, the “Main” method would be defined as a trigger. An assembly can have more than one trigger defined for it.

As Dotfuscator traverses each trigger method’s code, it notes which fields, methods, and types are being used. It then analyses all the called methods in a similar manner. The process continues until all called methods have been analyzed. Upon completion, Dotfuscator is able to determine a minimum set of types and their members necessary for the application to run. These and only these types are included in the output assembly.

For details, see the online user's guide.

© 2002-2007 PreEmptive Solutions. All rights reserved.