Command Line Interface
After you have configured Dotfuscator using the Dotfuscator Community user interface, you may also build using Dotfuscator Community's command line interface (CLI). This feature makes it easy to integrate Dotfuscator's protection into your build pipeline.
dotfuscatorCLI.exe. Starting in Dotfuscator Community 6, the name has changed to
dotfuscator.exe, which was previously the name of the graphical user interface. For more details, see Updating Paths to the Command Line Interface.
Activating the CLI
The command line interface is exclusively available to registered users of Dotfuscator Community. To activate the interface, see these instructions on how to register Dotfuscator Community.
Once your copy of Dotfuscator Community is registered, the CLI is activated automatically.
Dotfuscator Command Prompt
You can launch a command prompt that will have the command line version of Dotfuscator (
dotfuscator.exe) available on the path.
If you launch this command prompt while you have a config file open in the Dotfuscator user interface, then the Dotfuscator Command Prompt's working directory will be the location of the config file.
Locating the CLI
The CLI is located in the Dotfuscator Community install directory:
[VS Install Dir]\Common7\IDE\Extensions\PreEmptiveSolutions\DotfuscatorCE\dotfuscator.exe
[VS Install Dir] is the location of your Visual Studio installation.
For instance, Visual Studio 2017 Professional is installed by default at:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional
Using the CLI
The simplest way of using the CLI is to run
dotfuscator.exe with the path to an existing Dotfuscator config file as an argument.
dotfuscator.exe with the
-? option will display a list of additional options that can be used in the CLI.
Of particular interest is the
-p option, which can specify properties on the command line.
If a config file is specified alongside these options, the options usually override config file options for the build.
The only exception is with specifying Inputs (using the
-in flag), in which case the Inputs specified on the command line and the Inputs specified in the config file will be merged for the build.
For more use cases, including integration with MSBuild, see our blog post.
While we have provided command line support for Dotfuscator Community as a way to automate the protection process, please take note of the specific licensing restrictions. The Dotfuscator Community license expressly prohibits the use of the product by commercial organizations for anything other than personal research and education. If you would like to use Dotfuscator on commercial projects, please consider evaluating Dotfuscator Professional.