Dotfuscator User's Guide
Excluding Types

This option excludes a type by name or by attribute specifier. You can use a regular expression to specify the type name. Type names must be fully qualified names. Inner (nested) classes are specified by using the ‘/’ as a delimiter between outer and inner class. For example:

Inner (Nested) Classes
Copy Code
<type name="Library.Class1/NestedClass"/>

Attribute specifiers are selected or deselected with the speclist attribute. The speclist attribute is a comma-separated list of legal attribute specifiers for types. The legal values are:

Legal Values
Copy Code

A ‘-‘ preceding an attribute specifier negates the rule (i.e. it excludes all classes that do not have the specified attribute). A ‘+’ may be specified but is not required. The rules implied in this list are logically AND-ed together (that is, the set of excluded types is the intersection of all types that match each rule.). For instance, the following rule excludes any type that is public AND sealed.

Exclude Public and Sealed Type Rule
Copy Code
<type name=”.*” speclist=”+public,+sealed” regex=”true”/>

The <type> element may also be used to select a type in order to specify rules for field, method, property, and event exclusion within it. This allows members to be excluded while not excluding their owning type. The optional excludetype attribute is used for this purpose. If not specified, the default value is true, meaning that the type name will be excluded from renaming or control flow obfuscation.

Specify Rules for Field, Method, Property, and Event Exclusion
Copy Code
<type name="MyCo.Test.MyOtherTest" excludetype="false">
<!-- methods and fields excluded here -->

If a Type rule contains no Property or Event rules, then all property and event names in that excluded type are preserved. If a Type rule contains one or more Property rules, then only those property names will be preserved and all others will be removed. If a Type rule contains one or more Event rules, then only those event names will be preserved and all others will be removed.

Remember: If a type is not excluded and the library option is not set, then Dotfuscator removes property and event names.

Applies only to Renaming:

Type rules can be applied to entire inheritance hierarchies by specifying the applytoderivedtypes attribute. Setting the value of this attribute to true will apply the type rule and any Method, Field, Property, Event, Custom Attribute, or Supertype rules that it contains to the selected type and all types that derive from it. If not specified, the default value is false, meaning that the type rule will only be applied to the specified type.



© 2017 PreEmptive Solutions, LLC. All Rights Reserved.