Dotfuscator User's Guide
Property List and Properties

The optional <propertylist> section allows for the definition and assignment of variables known as <properties> that may be used later in the configuration file. Property definitions defined in this section are referred to as internal properties.

Internal Properties
Copy Code
<!-- define expandable properties -->
<!-- optional -->
  <property name="projectname" value="myproject"/>
  <property name="projectdir" value="c:\myprojects"/>

Variables, or property references, may be used in the configuration file without being defined in this section. For example, they may be defined on the command line or come from the environment.  Properties work via string substitution, using the following algorithm to find a value associated with the property:

  1. Check the external property list for a value.
  2. If not found, check for an environment variable with the same name as the property,
  3. If not found, check for an internal definition in the propertylist section of the configuration file,
  4. If still not found, use the empty string as the value.

External properties are passed in on the command line using the –p option. There are three built-in external properties:

Properties are useful for creating configuration files that act as templates for multiple projects, for different versions of the same project, or for simple portability across different build environments. A property is referenced with the following syntax:

Property Syntax
Copy Code

Property references are case sensitive, therefore ${MyProjectDir} references a different property than does ${myprojectdir}. Currently, property references may only be used as values in the dir or name attributes of the <file> element, and not just anywhere in the configuration file. Here is a list of sections that use the <file> element:

inputassembly mapinput mapoutput
output tempdir assembly
removalreport transform key
loadpaths program filelist
smartobfuscationreport pfx

A property reference is interpreted literally in any other place in the configuration file. Property references may not be nested as doing so results in an error.  Here is an example of a property reference in use:

Here is an example of a property reference in use:
Copy Code
  <file dir="${testdir}\output"/>



© 2016 PreEmptive Solutions, LLC. All Rights Reserved.