This repo uses Visual Studio to demonstrate
- Add a NuGet package to your final project (BasiExampleExe in this case).
- Use post build event to call Obfuscar with a XML configuration file.
Note: The example projects now generate an absolute-path Obfuscar configuration at build time named obfuscar.generated.xml. This avoids relying on relative paths (which are deprecated) and ensures the obfuscator receives absolute file locations for input/output and key files.
The obfuscated assemblies are in the output folder (.\BasicExampleExe\bin\Debug\Obfuscator_Output or .\BasicExampleExe\bin\Release\Obfuscator_Output).
Note that the NuGet package used in this example is packed for .NET Framework assemblies.
-
Install Obfuscar as a .NET Global Tool by running the following command in your terminal:
dotnet tool install -g obfuscar.console
-
Add a post build event to your final project (BasiExampleExe in this case) to call Obfuscar with a XML configuration file.
More information about Obfuscar Global Tool build for .NET can be found in the documentation.
Obfuscar Source Code can be found at GitHub.
The documentation can be found here.