Introducing the Cake.Eazfuscator.Net Addin

Published on 20 June 2018

What is it?

Cake.Eazfuscator.Net is a Cake Addin which provides the ability to execute the Eazfuscator.Net.exe. This is a tool that allows you to securely obfuscate your generated code, so that you can protect your investment in your code base.


To get started using this addin, all you need to do is add the following to your Cake script:

#addin "nuget:"

NOTE: Depending on the currently released version, you might want to change the above to reflect the current version number. The above is shown to ensure that the best practice of pinning your Cake Addin version numbers is adhered to.

With that done, you can perform a basic obfuscation of your code base using the following:

var CERT_PATH = EnvironmentVariable("PATH_TO_CERTIFICATE") ?? "";

    .WithCriteria(() => {
        return !string.IsNullOrWhiteSpace(CERT_PATH) && FileExists(CERT_PATH);
    .Does(() =>
        var filesToObfuscate = new List<FilePath>();

        var settings = new EazfuscatorNetSettings();
        settings.KeyFile = CERT_PATH;

        EazfuscatorNet(filesToObfuscate, settings);

This will result in the selected file(s) being obfuscated, using the settings defined (most likely) in the AssemblyInfo.cs file for the project.

There are various settings available which can additionally control how the obfuscation is performed.


You can find additional documentation for this addin here:

Source Code

The source code for this addin can be found here:

Chat Room

If you have any questions about this addin, then please feel to drop into the Gitter Chat room for all the addins and modules which exist in the cake-contrib organisation on GitHub:

Join the chat at

comments powered by Disqus