Eazfuscator.NET constantly evolves from one version to another. That's why some provisions should be made to ensure the successful integration of Eazfuscator.NET with your project over the time. This chapter describes all aspects related to compatibility in long-term perspective.
Compatibility version option instructs Eazfuscator.NET to mimic its corresponding version from the past. Why it should be used? The answer is very straightforward: usually Eazfuscator.NET is integrated with a project just once; after that the user of Eazfuscator.NET expects that integration will continue to flawlessly work whatever future version of Eazfuscator.NET is installed.
Eazfuscator.NET automatically configures the compatibility version during integration with the project. Depending on the integration type, Eazfuscator.NET uses one of two ways to specify the compatibility version:
In the case of the post-build event, the value is set via
-v command-line option:
In the case of the MSBuild-level integration, the value is set via
A group of pre-populated Eazfuscator.NET MSBuild properties configure the obfuscation integration.
Configures the compatibility version used by Eazfuscator.NET.
When using Eazfuscator.NET as a NuGet package, the MSBuild configuration properties are not populated automatically and should be added manually if needed.
The value of compatibility version should be equal to the version of Eazfuscator.NET that was used during the project integration stage. This guarantees that the future versions of Eazfuscator.NET will mimic the integrated version, thus delivering a solid upgrade path.
When compatibility version is not specified or its value is
top, Eazfuscator.NET assumes that compatibility version corresponds to the latest version of the product.
To learn how to change your project's compatibility version, please refer to the corresponding knowledge base article.
If you manually invoke Eazfuscator.NET from command line or from custom script then please ensure that compatibility version is supplied with
-v command line option.
Sometimes it may be useful to restrict the version of Eazfuscator.NET to work with. For example, some previous version of Eazfuscator.NET contained a bug which was later fixed, and some of your colleagues may still have that old version. It is not always possible to explicitly force the team members to upgrade Eazfuscator.NET to a newer version, that's why an ability to restrict the version of Eazfuscator.NET would be a good way to achieve this.
Please follow the instructions below to instruct Eazfuscator.NET to fail when its version is lower than required.
Instructions on forcing Eazfuscator.NET to fail when its version is lower than a given value
Open obfuscatable project inside the IDE
Add new source file to the project and call it
ObfuscationSettings.cs(for C#) or
ObfuscationSettings.vb(for Visual Basic .NET). You may prefer to use another name instead of
ObfuscationSettings.cswith the following content (C#):
[assembly: Obfuscation(Feature = "require eazfuscator.net version >= X.Y")]
For Visual Basic .NET, fill
ObfuscationSettings.vbwith the following content:
<Assembly: Obfuscation(Feature:="require eazfuscator.net version >= X.Y")>
X.Y with Eazfuscator.NET version number.
Support of this syntax appeared since Eazfuscator.NET 3.2. The syntax is ignored by previous versions of Eazfuscator.NET. If you have an absolute necessity to cover the previous versions too then please use the batch script approach shown in the section below.
Batch scripts usually reside in .bat or .cmd files, but can also be coded in post-build event of a project.
The following batch script can be used to demand a specific version of Eazfuscator.NET which is greater or equal to a given value
if /I "$(ConfigurationName)" NEQ "Release" goto SkipObfuscation
eazfuscator.net --check-version GEQ X.Y >NUL 2>NUL
if %ErrorLevel% NEQ 0 (
echo Eazfuscator.NET X.Y or higher is not installed on this machine. Obfuscation failed.
REM The line below resets error level to 0. Uncomment it if you want to force script to continue execution when no required version of Eazfuscator.NET is present
REM verify >NUL 2>NUL
) else (
eazfuscator.net "$(TargetPath)" --msbuild-project-path "$(ProjectPath)" --msbuild-project-configuration "$(ConfigurationName)" --msbuild-project-platform "$(PlatformName)" --msbuild-solution-path "$(SolutionPath)" -n --newline-flush -v <compatibility_version>
X.Y with Eazfuscator.NET version number.