The Dotfuscator Community extension adds tasks to your Azure DevOps build process that help you protect your applications from unauthorized decompilation, tampering, debugging, and data access.
The Dotfuscator Professional Azure DevOps Extension is now available!
Visit the Visual Studio Marketplace Entry to learn more about adding enhanced protection to your build process.
This extension is used to integrate Dotfuscator Community into Azure Pipelines.
Before you do that, you should be familiar with Dotfuscator Community itself, which is included with your local copy of Visual Studio.
These references will help you get started:
Usage
The extension installs the following tasks:
- A Provision task that configures Dotfuscator Community at the start of each build, and sets up a build variable that can be consumed in later build steps.
- A Protect task that runs Dotfuscator Community's command line tool, with user-specified arguments.
Requirements
- Azure Pipelines is required, or for earlier on-premises installations, Team Foundation Server 2015 Update 4 or later.
- Visual Studio 2015, 2017, or 2019 must be installed on your build hosts, with the Dotfuscator Community component installed.
Note that Microsoft-hosted agents that include Visual Studio already meet this requirement.
If you are using a custom build host, you can verify that Dotfuscator Community is installed by looking for its entry on Visual Studio's Tools menu.
It is installed by default in Visual Studio 2015; Visual Studio 2017 and 2019 users can install it via the Visual Studio Installer's "Individual Components" tab.
General Workflow
- Register your local copy of Dotfuscator Community.
This will allow you to use your local Dotfuscator Community command line interface as well as this extension.
- Create the Dotfuscator Community configuration file for your application by using Dotfuscator Community's UI with your locally built binaries.
- Remember to use relative paths or the ${configdir} property to reference your input assemblies.
- Add the configuration file to your project's source code repository.
- Add the Provision task to your build definition.
- Add a step to run Dotfuscator after your assemblies have been built.
The best way to do this will depend on your project:
- You can invoke the Dotfuscator command line interface directly, e.g. via an MSBuild exec task in one of your projects.
The Provision task exposes a build variable with Dotfuscator Community's location on the build host.
- You can use the Protect task to invoke Dotfuscator Community as a distinct step in your build definition.
- Ensure that your build saves the obfuscated output assemblies and the renaming map file as build artifacts (e.g. via a Copy Files task).
Provision Task
The Provision step is required in order to activate the Dotfuscator Community command line interface on the build host. Add the Provision step to your build definition, anywhere before Dotfuscator Community runs.
Inputs:
- Serial Number: The serial number you received when you registered your local copy of Dotfuscator Community.
You may need to add "-391" to the end of the serial number you recieved via email.
The serial number is also available from the Help -> About menu in the Dotfuscator Community GUI.
- Dotfuscator Version: The Dotfuscator distribution you wish to build with, corresponding to the selected Visual Studio version.
This must be set to the version of Visual Studio installed on the build host.
- User Specified Environment Variable: Users with custom build hosts can optionally provide the name of an environment variable specifying a directory containing Dotfuscator Community.
Only set this if Visual Studio is not installed in the default location on the build host.
When run, the Provision step sets and exposes a build variable called DotfuscatorCEDir, which points to the location of the Dotfuscator Community command line executable on the build host. Later steps in your build can use this to invoke Dotfuscator Community (e.g. via an MSBuild Exec task).
Protect Task
The Protect task runs the Dotfuscator Community command line interface on the build host using the specified configuration file and arguments.
It uses the DotfuscatorCEDir build variable exposed by the Provision task to locate Dotfuscator Community.
Inputs:
- Relative Path To Configuration File: The path to the Dotfuscator configuration file, relative to the repository root.
- Additional Arguments To Dotfuscator: Any additional command line arguments that Dotfuscator Community supports.