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.
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 (
dotfuscatorCLI.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\dotfuscatorCLI.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
dotfuscatorCLI.exe with the path to an existing Dotfuscator project file as an argument.
dotfuscatorCLI.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 project properties on the command line.
If a project file is specified alongside these options, the options usually override project 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 project 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.