Settings
The Settings screen is used to configure config-wide settings. You can access this screen in Dotfuscator Community's navigation tree by selecting Settings. The options are divided among six tabbed views, though the features of three tabs are exclusive to Dotfuscator Professional.
General Tab
This is where you set general settings for the Dotfuscator config, including the output directory and the verbosity of the Build Output panel.
Directories
In the Directories section, you may configure two directory values either by manually typing a path, or by browsing with the "Browse..." buttons.
Temporary directory: Optional. Specifies a directory for temporary files to be placed when Dotfuscator builds the config. If unspecified, a temporary directory provided by the OS is used.
Destination directory: Required. Specifies the directory to which Dotfuscator will write modified assemblies and packages. If the directory does not exist, Dotfuscator will create it. Defaults to
${configdir}\Dotfuscated
; that is, a subdirectory of the directory in which the Dotfuscator config file is defined, namedDotfuscated
.
Build Configuration
In the Build configuration section, you may configure options related to the Dotfuscator build in general.
Investigate only: If enabled, no assemblies or packages will be written out. This allows you do a "dry run" of the Dotfuscator config, as well as create map files or reports without needing to generate modified assemblies.
Emit debugging symbols: Control how Dotfuscator creates updated debugging symbols (PDB files) for protected assemblies:
If enabled, Dotfuscator will create debugging symbols that match the format of the input assembly's debugging symbols.
Otherwise, no debugging symbols will be included in the output, even if input assemblies have debugging symbols.
Build output verbosity: Choose how much information is displayed in the Build Output pane:
"Quiet": Less build information is displayed than normal.
"Default": Normal build information is displayed.
"Verbose": Additional build information is displayed, including the output of calls to SDK tools. Useful if you are attempting to fine-tune your results.
Global Obfuscation Settings
In the Global obfuscation settings section, you may configure options related to obfuscation.
Inherit obfuscation attributes: If enabled, any use of an Obfuscation Attribute on a type will also apply to its derived types, and any use of Obfuscation Attribute on a method will also apply to methods that override it.
Smart obfuscation: If enabled, Smart Obfuscation will be used.
Suppress Ildasm: If enabled, the
SuppressIldasmAttribute
will be added to all of your output assemblies.Smart obfuscation reporting: Choose how much information from Smart Obfuscation is reported:
"All": Both warnings and information will be displayed.
"Warnings only": Warnings will be displayed.
"None": No messages from Smart Obfuscation will be displayed.
Properties Tab
Properties can be thought of as simple string substitution macros that may be used wherever a filename or path is required.
The Properties screen is where you can view, delete, and manually add user-defined name/value pairs as Config Properties and to view External Properties.
External properties are those either defined by Dotfuscator (such as configdir
and appdatadir
) or those passed on the command line via the -p
switch.
Properties are especially useful in creating obfuscation build templates to support multiple project configurations.
Properties are referenced with the following syntax:
Property Reference Syntax
${property_name}
Property references are case sensitive, therefore ${MyConfigDir}
references a different property than does ${myConfigdir}
.
Property references are interpreted literally and may not be nested.
Currently, property references may only be used as values in the dir
or name
attributes of the <file>
element, such as in the path that defines an Input.
Dotfuscator uses the following algorithm to find a value associated with the property:
- Check the external property list for a value.
- If not found, check for an environment variable with the same name as the property.
- If not found, check for a config property.
- If still not found, use the empty string as the value.
External Properties
The External Properties section is a read-only table listing external properties that Dotfuscator defines. For each row, the Property column contains the name of the property, and the Value column contains the value of that property. Dotfuscator defines the following three Properties and Values:
applicationdir
reflects Dotfuscator's installation directory, where the Dotfuscator application files are located.appdatadir
reflects Dotfuscator's local data directory.configdir
reflects the directory in which the current config file resides.
Config Properties
The Config Properties section allows for the definition and assignment of arbitrary additional properties that will be used during the build process.
These properties will be evaluated in the same manner as the external properties.
In the above example, myconfigdir
is the Property and myconfig
is the Value of the Property.
Assembly Load Paths Tab
When Dotfuscator builds a config, it needs to load assemblies referenced by the input assemblies in order to discover information about referenced types. Dotfuscator typically uses similar rules to other .NET tools when discovering these assemblies.
You can also specify custom locations to look for referenced assemblies. This means it's possible to build a Dotfuscator config that references third-party assemblies, without having to include those assemblies in the config.
If a referenced assembly cannot be found using the default search rules, Dotfuscator provides a way for you to specify additional directories in which to look for referenced assemblies. Dotfuscator searches these directories in the specified order as the last step in its algorithm. However, if the "Search First" checkbox is checked, then Dotfuscator searches the load path before applying its standard search.
Using the editor in this tab, you can edit your config's user defined assembly load paths. From the toolbar, you can add or remove directories, edit existing directories, or change the order in which they are searched. When you click Add, this window displays:
When the path is specified, click OK. The path now displays in the User Defined Assembly Load Path window:
Check the Search First checkbox to have Dotfuscator search the load path before applying its standard search. When unchecked, Dotfuscator will search the loadpath only after applying its standard search.
Feature Map Strings Tab
As part of Declarative Obfuscation, Dotfuscator recognizes various strings that can be used in the Feature property of the ObfuscationAttribute
:
"renaming"
indicates to Dotfuscator that the attribute specifies instructions for the renaming feature of Dotfuscator."all"
and"default"
are aliases of"renaming"
.
From the toolbar, you can add, edit, and remove additional strings for Dotfuscator to recognize in the Feature Map Strings tab. The Add button brings up a dialog that allows you to map feature strings to supported Dotfuscator features.
When a feature is selected, the Edit and Delete buttons are activated. Selecting Edit brings up a dialog that allows you to edit the map feature strings to supported Dotfuscator features.
In the Dotfuscator config of the above screenshot, the string "testmode"
will indicate to Dotfuscator that an attribute specifies instructions for its renaming feature.
The two pieces of code below are equivalent:
Use of "renaming"
feature string:
[System.Reflection.Obfuscation(Exclude=true, Feature="renaming")]
public void CalledFromReflection(int someValue) {
Use of "testmode"
map string:
[System.Reflection.Obfuscation(Exclude=true, Feature="testmode")]
public void CalledFromReflection(int someValue) {
In Dotfuscator Community, renaming is the only available feature. Dotfuscator Professional supports additional obfuscation features, and thus supports additional meanings for a Map String.
Build Events Tab
In Dotfuscator Professional, Dotfuscator can be configured to run arbitrary Windows commands before and after Dotfuscator's processing. This is helpful when integrating Dotfuscator into a build pipeline.
This feature is not available in Dotfuscator Community, so this tab instead notes that the feature is exclusive to Professional.
Signing Tab
When Dotfuscator processes a strong-named input assembly, the signature information is not included in the output assembly. Dotfuscator Professional offers the ability to automatically re-sign these types of assemblies after processing.
This feature is not available in Dotfuscator Community, so this tab instead notes that the feature is exclusive to Professional.