Repeatable release builds

Automate .NET obfuscation in CLI builds

Once a protection job works in the desktop app, save it as a .cfsprj project and run the same settings from the CLI. Check the deployment preview before adding the command to your build pipeline.

Validate the project in the desktop app

  1. Add the managed DLL or EXE, choose a preset and exclusions, and set an output location.
  2. Protect the app once and test behavior and speed on a target machine.
  3. Save MyApp.cfsprj. Under Output location → Generate CLI command, copy the PowerShell or CMD form for your setup.

The project contains input paths and deployment settings. Make sure those paths exist on the build machine. The license is bound to one PC, so check its status under the account and machine that run the automated job.

PowerShell example

Run these commands from the root of the Confuser Studio installation. Replace the project path and output folder with your own.

& '.\cli\Confuser.Cli.exe' '.\MyApp.cfsprj' --preview-deployment
& '.\cli\Confuser.Cli.exe' '.\MyApp.cfsprj' --output 'D:\Protected'
& '.\cli\Confuser.Cli.exe' --license-status

--preview-deployment reports inputs and excluded files as JSON. Use --diagnostics when investigating a failure. A CI step should stop if the CLI returns an error:

& '.\cli\Confuser.Cli.exe' '.\MyApp.cfsprj' --output 'D:\Protected'
if ($LASTEXITCODE -ne 0) { throw 'Confuser Studio protection failed' }

Keep deployment and diagnostic files separate

FolderHandling
deploymentContains the files to deploy. Check whether your app still needs original configuration, data, or native DLLs.
privateContains name maps and reports. Retain these with the matching release; do not distribute them with customer files.
For the normal workflow, protect managed IL before ReadyToRun, Native AOT, or single-file publishing. If you need the ReadyToRun integration path, read the build requirements first.

Before enabling CI

See the complete CLI manual for the command generator and option details.

User manual