You can install Dotfuscator Professional using a NuGet package that PreEmptive privately distributes. This installation method supports running Dotfuscator on your macOS and Linux development machines. You can also use this method for Windows development environments, but the Windows installer is typically recommended instead.
Build agents can also use the NuGet package for installation. See Build Agents for details.
About the NuGet Package
While you may be familiar with using NuGet to add third-party libraries from nuget.org to your projects, the Dotfuscator NuGet package works quite differently:
- The package does not expose libraries for general programming use. Instead, it contains Dotfuscator's various components, which act as independent tools during a build.
- You do not add a reference to the Dotfuscator NuGet package in your project. Instead, you explicitly install the package to a directory and have your builds use the extracted components in that directory.
- The package is not available on the public nuget.org feed. Instead, PreEmptive distributes the package privately, and you must host it on a private feed within your organization.
The package's ID is PreEmptive.Protection.Dotfuscator.Pro. (For customers evaluating Dotfuscator Professional, add .Eval to the end of this ID.)
This page discusses the private NuGet package which contains Dotfuscator itself. There is also a more traditional NuGet package available on nuget.org which contains Check Attributes. Your project can reference this NuGet package and use the provided attributes to annotate your code. When Dotfuscator runs, it recognizes these attributes in your compiled code and injects Checks accordingly.
System Requirements
To install Dotfuscator with the NuGet package, you need a way to install NuGet packages to a local directory. The easiest way is to use the NuGet command line interface (nuget.exe), but you can also use a different NuGet interface or any tool capable of extracting ZIP files. See the Installation Instructions for details.
The package itself has two sets of components, divided into two subdirectories. Each set of components has separate system requirements.
-
tools/msbuilddircontains Dotfuscator's MSBuild components. Most developers should use these components, as they integrate into the normal build process of most .NET projects. See the MSBuild Requirements section for details. -
tools/programdir/netcorecontains the .NET 6 version of the command line interface. See the Command Line Interface Requirements section for details.
MSBuild Requirements
The requirements for running the MSBuild components installed by the NuGet package are:
-
MSBuild - any of the following:
- MSBuild for .NET Framework: 4.0 or later, running on .NET Framework 4.7.2 or later
- MSBuild for .NET Core: 16.0 or later, with the .NET 10 SDK installed
- MSBuild for Mono: 16.0 or later, running on Mono 6.0 or later
You use the MSBuild components, when installed via the NuGet package, in builds running on Windows, macOS, and Linux. However, certain features, such as .pdb file generation, require the full .NET Framework SDK (version 1.1 or later), which is exclusive to Windows.
Supported Development Tools
The table below shows which development tools Dotfuscator supports when you use the NuGet package.
| Development Tool | Supported Versions | Integration Capabilities |
| Visual Studio (for Windows) | 2012 and later. Community, Professional, and Enterprise are supported. |
You can integrate Dotfuscator into projects for .NET Framework, .NET 5, .NET Core, .NET Standard, Xamarin, and MAUI. Dotfuscator runs during builds started from the Visual Studio IDE and from the msbuild and dotnet command line tools. Installing Visual Studio (with a .NET workload in VS 2017 and later) also satisfies the .NET runtime and .NET SDK requirements. |
| Visual Studio for Mac | 2019 and later. | You can integrate Dotfuscator into projects for .NET 5, .NET Core, .NET Standard, Xamarin, MAUI, and Mono. Dotfuscator runs during builds started from the Visual Studio for Mac IDE and from the command line tools that are installed with Visual Studio for Mac: msbuild and dotnet. |
| Visual Studio Code | Any version. | You can integrate Dotfuscator into any .NET-based project. Dotfuscator runs during builds which are triggered through build tasks that call supported msbuild and dotnet tools. Visual Studio Code does not include these tools; install them via an SDK or another IDE. |
| .NET Framework runtime | 4.0 and later. | You can integrate Dotfuscator into projects for .NET Framework and .NET Standard. Dotfuscator runs during builds started from the .NET Framework msbuild command line tool, on Windows only. |
| .NET Core SDK | 2.1 and later (latest patch versions) | You can integrate Dotfuscator into projects for .NET Core and .NET Standard. Dotfuscator runs during builds started from the .NET Core dotnet command line tool, on Windows, macOS, and Linux. |
| Mono SDK | 6.0 and later | You can integrate Dotfuscator into projects for Mono and .NET Standard. Dotfuscator runs during builds started from the Mono msbuild command line tool, on Windows, macOS, and Linux. |
Command Line Interface Requirements
The requirements for running the command line interface installed by the NuGet package are:
-
.NET runtime: .NET 6 or later
The command line interface, when installed via the NuGet package, can run on Windows, macOS, and Linux. However, certain features, such as .pdb file generation, require the full .NET Framework SDK (version 1.1 or later) which is exclusive to Windows.
Installation Instructions
Your organization may have already hosted the Dotfuscator NuGet package internally. If so, note the NuGet feed URL where the package is hosted.
Otherwise, do the following:
- Download the NuGet package to your development machine. Go to the Dotfuscator Downloads page and download Dotfuscator Professional's NuGet Package.
- Copy the downloaded
.nupkgto a new directory. - Note the path to this directory as your NuGet feed URL.
Once the NuGet package is hosted or downloaded, you can provision it on your development machine. There are multiple ways to do this, shown in the tabs below.
nuget.exe InstallThe NuGet command line interface (CLI) uses the install verb to provision Dotfuscator. You can download this CLI as nuget.exe, which runs on Windows or under Mono. If your machine runs macOS and has Visual Studio for Mac installed, you already have the NuGet CLI available at /Library/Frameworks/Mono.framework/Commands/nuget.
Here is an example command for provisioning Dotfuscator:
nuget install PreEmptive.Protection.Dotfuscator.Pro[.Eval] -Version 7.1.4 -OutputDirectory "{out dir}" -ExcludeVersion -Source "{feed url}"
Where:
-
[.Eval]is.Evalif you are evaluating Dotfuscator Professional and is the empty string otherwise. -
{out dir}is the directory where the Dotfuscator NuGet package is extracted. -
{feed url}is the NuGet feed URL you noted earlier.
This installs Dotfuscator to {out dir}/PreEmptive.Protection.Dotfuscator.Pro[.Eval]. Note this installation directory for the next set of instructions.
The NuGet package (.nupkg) file is actually a renamed ZIP file. Copy the .nupkg file to a new name with the .zip extension, and then unzip that copy into a new directory. (If the NuGet package is hosted on an artifact repository in your organization, consult the repository's documentation to download the .nupkg file.)
After unzipping the package, the directory of unzipped contents is your installation directory. Note this installation directory for the next set of instructions.
You can create a simple "stub" .NET project that references the Dotfuscator NuGet package. Then, provision the package using a NuGet restore command on the "stub" project.
For details, see NuGet Restore on the Build Agents page.
Before calling the included shell scripts, you may need to mark them as executable. You typically do this by calling chmod +x with the script location as the argument.
After provisioning, you need to set some environment-specific settings. Create a file named .dotfuscator.user.props in your user directory (i.e., the directory found in the USERPROFILE or HOME environment variables) with the following content:
<!-- This is an MSBuild properties file for projects which use Dotfuscator's MSBuild components.
For details, see <https://www.preemptive.com/dotfuscator/pro/userguide/en/interfaces_msbuild.html#user>.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Path where Dotfuscator's MSBuild components are installed via the NuGet package. -->
<DotfuscatorMSBuildDir>{install dir}/tools/msbuilddir</DotfuscatorMSBuildDir>
<!-- License string for Dotfuscator. -->
<DotfuscatorLicense>{license string}</DotfuscatorLicense>
</PropertyGroup>
</Project>
Where:
-
{install dir}is the absolute path to the Dotfuscator installation directory you noted. -
{license string}is your Dotfuscator Professional license key formatted as a license string. This causes Dotfuscator's build integration to automatically activate itself each time it runs.
Now you can follow the Protect Your App instructions to integrate Dotfuscator into your build.
Installed Components
Dotfuscator's NuGet package contains the following components:
| Component | Installation Location |
| MSBuild targets | {install dir}/tools/msbuilddir/PreEmptive.Dotfuscator.Common.targets |
| MSBuild tasks (modern) | {install dir}/tools/msbuilddir/PreEmptive.Dotfuscator.Tasks.dll |
| MSBuild tasks (legacy) | {install dir}/tools/msbuilddir/legacy/PreEmptive.Dotfuscator.Tasks.dll |
| Command line interface |
{install dir}/tools/programdir/netcore/dotfuscator.dll (.NET Core app) |
Where {install dir} is the Dotfuscator installation directory you noted in the Installation Instructions.