PreEmptive Protection - Dotfuscator 4.31
User Guide

MSBuild Task Reference

Dotfuscator provides an MSBuild interface using tasks defined in PreEmptive.Dotfuscator.Tasks.dll. This DLL is installed into the following subdirectories of the MSBuild extensions directory:

$(MSBuildExtensionsPath)\PreEmptive\Dotfuscator\<major>
$(MSBuildExtensionsPath)\PreEmptive\Dotfuscator\<major>\<major>.<minor>
$(MSBuildExtensionsPath)\PreEmptive\Dotfuscator\<major>\<major>.<minor>\<major>.<minor>.<patch>

For example if version 4.11.5 of Dotfuscator is installed you will see the following directories:

$(MSBuildExtensionsPath)\PreEmptive\Dotfuscator\4
$(MSBuildExtensionsPath)\PreEmptive\Dotfuscator\4\4.11
$(MSBuildExtensionsPath)\PreEmptive\Dotfuscator\4\4.11\4.11.5

There is also a targets template that you can import into your MSBuild scripts, PreEmptive.Dotfuscator.Targets. This file is installed into the same directories.

The layout is designed so that when writing your own msbuild files you can point to the most specific version desired. For more information see the section on Side by Side Installs.

Dotfuscate Task

You can run Dotfuscator from MSBuild using the Dotfuscate task. Below are the properties provided by the Dotfuscate task.

Property Type Description
ConfigPath String Write Only. Sets the path to the Dotfuscator configuration file.
DebugSymbols String[] Read Only. Exposes PDB files associated with output assemblies. The PreEmptive.Dotfuscator.Targets file exposes this property as an output Item named DotfuscatedDebugSymbols
InputAssemblies ITaskItem[] Write Only. Currently, the input assemblies must also be listed in the configuration file. This is only for interoperation with Visual Studio generated project files. This may change in the future.
MappingFile String Read Only. Exposes renaming map file.The PreEmptive.Dotfuscator.Targets file exposes this property as an output Item named DotfuscatorMappingFile.
OutputAssemblies String[] Read Only. Exposes output assemblies. The PreEmptive.Dotfuscator.Targets file exposes this property as an output Item named DotfuscatedAssemblies.
ReportFiles String[] Read Only. Exposes report files such as renaming HTML report and removal reports. The PreEmptive.Dotfuscator.Targets file exposes this property as an output Item named DotfuscatorReportFiles.
SatelliteAssemblies String[] Read Only. Exposes satellite assemblies associated with output assemblies. The PreEmptive.Dotfuscator.Targets file exposes this property as an output Item named DotfuscatedSatelliteAssemblies.
Properties String Write Only. Sets user defined external properties. The string must contain a valid XML element with child elements that represent key/value pairs.
For example:
<Properties>
<Property1>Value1</Property1>
<Property2>2</Property2>
</Properties>

Dotfuscator Project Files in Visual Studio 2005 and later

If you are using the Visual Studio integrated version with Visual Studio 2005 and higher, your Dotfuscator project files are automatically persisted in MSBuild format, so you should be able to take your project tree over to a build machine using MSBuild without Visual Studio and have the build perform the same as it would inside Visual Studio.

PreMark Task

You can extract watermarks from previously watermarked assemblies using the PreMark task. This provides similar functionality to the command line program Premark.exe included in your Dotfuscator installation directory.

Property Type Description
InputAssemblyPath String Required, Read,Write. Gets or sets the path to the Assembly whose watermark you want to extract.
UsePassphrase Boolean Read,Write.
Passphrase String Read,Write. Currently, the input assemblies must also be listed in the configuration file. This is only for interoperation with Visual Studio generated project files. This may change in the future.
Watermark String Read Only. Exposes the extracted watermark string.

Dotfuscator Version 4.31.0.6091. Copyright © 2017 PreEmptive Solutions, LLC