Ee958439.collapse(en-us,VS.110).gif Ee958439.expand(en-us,VS.110).gif Ee958439.copycode(en-us,VS.110).gif Ee958439.copycodeHighlight(en-us,VS.110).gif Ee958439.drpdown(en-us,VS.110).gif Ee958439.drpdown_orange(en-us,VS.110).gif
PreEmptive Dotfuscator and Analytics Community Edition 5.5

Glossary Item Box

The Properties item on the navigation tree brings up the Properties configuration in the work area. It contains six tabs, three of which are available to Dotfuscator and Analytics CE users.  

Project Properties

Project Properties can be thought of as simple string substitution macros that may be used wherever a filename or path is required. The Project Properties screen is where you can view, delete, and manually add user-defined name/value pairs as Project Properties and to view External Properties.  External properties are those either defined by Dotfuscator (e.g. configdir, appdatadir) or those passed on the command line via the /p switch.  Project Properties are especially useful in creating obfuscation build templates to support multiple projects and configurations. Properties are referenced with the following syntax:

Property Reference SyntaxEe958439.copycode(en-us,VS.110).gifCopy Code

Property references are case sensitive, therefore ${MyProjectDir} references a different property than does ${myprojectdir}. 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. 

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 project property.
  • If still not found, use the empty string as the value.


External Properties

The Property column contains the name of the property, and the Value column contains the value of that property. Dotfuscator and Analytics CE defines the following three Properties and Values:

  • applicationdir reflects Dotfuscator and Analytics' installation directory where the Dotfuscator application files are located.
  • appdatadir reflects Dotfuscator and Analytics' local data directory.
  • configdir reflects the directory in which the current project's configuration file resides.

Project Properties

This 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, projectdir is the Property and myproject is the Value of the Property.

Feature Map Strings

The Feature Map Strings section is used for Declarative Obfuscation. Declarative Obfuscation is implemented via attribute decoration within the source code while it is being written.  The attributes that are used to control Declarative Obfuscation are System.Reflection.ObfuscateAssemblyAttribute and System.Reflection.ObufscationAttribute. System.Reflection.ObfuscateAssemblyAttribute controls the obfuscation of the assembly as a whole. System.Reflection.ObufscationAttribute controls the obfuscation of individual types and their members.  Feature Map Strings enable you to declare, within the source code, what should and should not be obfuscated by using attributes.


In this section, you can add, edit, and remove feature map strings. To add a map string, click in the Map String field and type the name of the string.  When you do this, a row of checkboxes displays beneath the current row containing the feature you can select.  For example,

  • testmode is the name of the Map string that was entered
  • renaming is the Feature of the Map string that was selected from the row beneath. 

In Dotfuscator and Analytics CE, renaming is the only available feature. Commercial versions of Dotfuscator support additional features as follows:  

Feature StringAction
*controlflowattribute configures control flow obfuscation.
*stringencryptionattribute configures string encryption
*triggerattribute configures pruning by marking the annotated item as an entry point
*conditionalincludeattribute configures pruning by conditionally including the annotated item

By decorating items with an obfuscation attribute and ensuring that their input assemblies are set to honor obfuscation attributes, you can specify which items in you application should not be renamed.  In the following code sample your method is invoked via reflection and should be excluded from renaming.

Invoked via Reflection, Excluded from Renaming:Ee958439.copycode(en-us,VS.110).gifCopy Code
[System.Reflection.Obfuscation(Exclude=true, Feature="renaming")]
public void CalledFromReflection(int someValue) {

If you need to exclude a method from obfuscation in a specific build configuration, then create a Feature Map declaration and set the feature value of the obfuscation attribute to match.  In the screenshot above, we have set a Feature Map string of "testmode" that will be used to exclude items from being renamed.  In the code sample below, we have decorated our method so that it will be renamed by Dotfuscator unless the "testmode" feature string is defined.

Testmode Feature Map Declaration:Ee958439.copycode(en-us,VS.110).gifCopy Code
[System.Reflection.Obfuscation(Exclude=true, Feature="testmode")]
public void OnlyCalledFromReflectionInTestMode(int someValue){

Build Settings

 This is where you set the destination directory, build configuration, and global obfuscation settings.



The Destination directory: is required as that is where the output from the build will reside.  For example, you would type ${projectdir}\output in this field, or click Browse to determine its location.

Build Configuration

Selecting Investigate only shows you what will occur as a result of processing the input assemblies, without actually writing output assemblies. This is useful for creating map files and reports.

Build output verbosity: enables you to determine the am

The Temporary directory: is optional and is used to store temporary files during processing. By default Dotfuscator and Analytics CE uses your Windows Temporary directory.  If you wish to specify this directory, enter the name of the directory in this field.  For example, you could enter ${projectdir}\temp in this field, or click Browse to determine its location. 

ount of information presented to you in the Build Output panel.  Selecting Quiet keeps the output information minimal. Selecting Verbose provides you detailed information about all actions occurring during the build process.  The Verbose option is especially helpful if you are attempting to fine-tune your results. 

Global Obfuscation Settings

In this section, you can select or deselect Inherit obfuscation attributes and Smart obfuscation.  Inherit obfuscation attributes specifies whether an obfuscation attribute that is put on a type will also be applied to derived types. Smart Obfuscation uses static analysis to determine what elements should be excluded from renaming. Sometimes a rule can recognize that an action needs to be taken, but cannot determine what specific action to take because static analysis does not yield enough information. When this happens, the rule issues a warning.

You can also determine if you want Smart obfuscation reporting by selecting All for all messages, None for no messages, or Warnings only. When Smart Obfuscation is enabled, and the project is built, a Smart Obfuscation report will be presented in its own tab near the Build Output tab and if any Smart Obfuscation warnings are generated, they will be presented in the Smart Obfuscation Warnings tab.


Assembly Load Path, Build Events, and Signing

These features are exclusive to Dotfuscator Professional Edition. To request information and a free 14-day evaluation (where applicable), click the Try Now button on the toolbar. To learn how to purchase Dotfuscator Professional Edition, click the Buy Now button on the toolbar. Alternatively, you may select these options from the Help menu.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft