Published Wednesday, September 13, 2017
Category Release Notes
Author mholo65

Version 0.22.0 of Cake has been released.

So, let’s be clear, this release will break things — but it is all intentional!

This release was initially about updating Roslyn, unifying scripting engines, and targeting .NET 4.6. But one thing led to another which resulted in better support for tool and addin versioning when using preprocessor directives, and an optional in-process NuGet client.

Updating Roslyn and unifying scripting engines has been a long-awaited improvement for many of you. This brings you C# 7 features (without need for --experimental switch), debugging with Mono (as we completely removed the old Mono scripting engine), and much, much more. It also allows us to ship Roslyn with Cake, so there's no need for Cake to actually download Roslyn anymore. In order for us to update Roslyn, we also needed to change target framework to .NET 4.6.

Tool and addin versioning when using preprocessor directives has been an issue, which has caused many questions. E.g. you may have noted that when changing version for a tool or addin, the old version was still used. Prior to this release, the only solution was to delete the tool/addin from the tools folder. This is now fixed as Cake supports side-by-side downloading of different versions of tools and addins.

Due to unpredictable results when downloading packages using nuget.exe, tool/addin versioning was solved by adding a intermediate directory containing the version number. This intermediate directory can however cause MAX_PATH issues when downloading some specific packages. To address this issue, we implemented functionality in Cake.NuGet to allow Cake to download tools and addins without the need for nuget.exe. This functionality is currently optional through configuration, and is the first step towards removing need for nuget.exe in Cake. Example usage to opt-in for the in-process NuGet client:

Cake.exe --nuget_useinprocessclient=true

The in-process NuGet client also gives the possibility to load assemblies from NuGet dependencies. This behaviour can be enabled either via configuration or directive. Example usage for loading dependencies:

Cake.exe --nuget_useinprocessclient=true --nuget_loaddependencies=true


#addin nuget:?package=foo&loaddependencies=true #addin nuget:?

As 0.22.0 has several breaking changes, it will require addins to reference Cake.Core 0.22.0 or newer to be loaded, there’s a “you’re on your own anything can happen” setting to skip verification but we recommend to start targeting the newer version as soon as possible. Example usage to skip verification:

Cake.exe --settings_skipverification=true

We have said it before, but here it comes again. Regardless of intentional or unintentional breaking changes, the possibility of new releases breaking something is why we always recommend you pin the version of Cake you’re running, thus avoiding any unplanned broken builds. You can read more about pinning Cake version here. We always try to avoid breaking changes, but we think these new features and improvements justify the friction, and we hope you will too!

And as always thanks to all Cake contributors and users, Cake wouldn’t have been possible without you!

Contributions were included from:

Full details of everything that was included in this release can be seen below.

As part of this release we had 49 issues closed.

Breaking changes

  • #1785 Bump LatestBreakingChange to 0.22.0
  • #1745 Change parameter for InstallTools and InstallAddins in IScriptProcessor
  • #1720 ILRepackSettings.Libs should be List of DirectoryPath
  • #1719 Jenkins BRANCH_NAME is missing
  • #1714 Updated CakeRuntime.TargetVersion to net462.
  • #1674 MSBuildFileLogger LogFile is a string and not a FilePath
  • #1665 NUnit3Settings: Params and multiple results
  • #1651 NUnit3Settings Verbose flag obsoleted by NUnit console runner
  • #1614 Correct the class that TeamCityEnvironmentInfo inherits from
  • #1597 CommitsSinceVersionSource and PreReleaseNumber as Integer
  • #1564 DeleteDirectory cannot delete read-only files
  • #1540 Upgrade to Roslyn 2.0


  • #1791 Add option to enable MSBuild binary logging
  • #1771 Look for msbuild in default install path on Linux
  • #1761 DoesForEach() extension method
  • #1754 VSWhere not returning “prerelease” versions
  • #1743 Implement functionality in Cake.NuGet for downloading packages
  • #1734 Add GitLink 3 compatible aliases
  • #1710 Add alias for simple sub-directory listing
  • #1699 NuGetPackSettings missing language/locale ID for the package
  • #1670 OpenCover is missing some commandline parameter (for example mergebyhash)
  • #1667 Add support for choco download internalize-all-urls
  • #1621 Add overload for StartProcess which also returns redircted error output


  • #1775 Strange usage of Cake.Core.dll when executing cake sub process
  • #1773 NuGetHasSource call do not take care of ArgumentCustomization in NuGetSourcesSettings
  • #1759 XmlPoke always writes the xmldeclaration even if the original file didn’t have one
  • #1742 Some unit tests are locale-sensitive
  • #1739 NuGetContentResolver can’t find assemblies if located in root
  • #1738 NuGetInstaller can’t resolve files if package contains dependencies
  • #1697 CakeContextAdapter do not implement ICakeContext
  • #1694 Addin directive shouldn’t attempt to load native assemblies
  • #1693 Possible bug when setting process environment variable
  • #1625 Comma in msbuild commands are not escaped
  • #1602 MSBuildFileLogger Verbosity does not accept Verbosity.Verbose
  • #1537 XmlPeek not working correctly for element nodes
  • #1422 Error: Unkown token when directory contains multibyte characters


  • #1752 Extend DownloadFile to allow AcceptEncoding gzip
  • #1746 ScriptAnalyzer.Analyze() should not throw, instead return list of errors
  • #1704 Move CakeConsole & CakeBuildLog to Cake.Core and made CakeConfiguration public
  • #1512 Please support C# 7 and Roslyn v2
  • #753 Tool Versioning


  • #1787 Add opt-out config information to assembly version verification error message
  • #1780 Fix typo in version.cake
  • #1727 Incorrect documentation for XmlPeek Alias
  • #1700 Update nuget license url
  • #1525 Updated examples for DotNetCoreTest

Originally published at

Cake (C# Make) is a build automation system