Library Mode By Assembly

This setting tells Dotfuscator that a particular input assembly constitutes a library. (For Dotfuscation purposes, a library is defined as an assembly that is going to be referenced from other components not specified as one of the inputs in this run) This has implications for renaming and pruning, regardless of any custom excludes you may have set.

In Dotfuscator Community Edition, the library option applies to all input assemblies. If any one input assembly is marked as a library, then all input assemblies are considered libraries.

Here are the rules when using the library option:

  1. Names of public classes and nested public classes are not renamed. Members (fields and methods) of these classes are also not renamed if they have public, family, or famorassem access.
  2. In addition, no virtual methods are renamed, regardless of access specifier. This allows clients of your library to override private virtual methods if need be (this is allowed behavior in the .NET architecture).
  3. Any user-specified custom renaming exclusions are applied in addition to the exclusions implied by the above rules.
  4. Property and Event metadata are always preserved.

If you do not have the library option set for an assembly, then you are telling Dotfuscator that your input assembly is a standalone application, or that it will only be referenced by other input assemblies. In this case obfuscation is much more aggressive:

  1. Everything is renamed except methods that override classes external to the application (i.e. classes in assemblies that are not included in the run.)
  2. Property and Event metadata is removed, since this metadata is not required to run the application (it is meant for “consumers” of library code).
  3. As usual, user specified custom renaming exclusions are also applied.

To specify library mode for an input assembly, add an <option> element to its <inputassembly> element.

      <inputassembly>
        <option>library</option>
        <file dir="c:\temp" name="myproj.dll"/> 
      </inputassembly>

© 2002-2007 PreEmptive Solutions. All rights reserved.