Cake v0.23.0 released

Sunday, October 15, 2017
Release Notes

Version 0.23.0 has been released!

This release contains three new features specially worth highlighting and a lot of bugfixes and improvements.

Asynchronous Tasks

Cake now supports asynchronous tasks. This will let you use the async and await C# features within a task.

Tasks will still execute single threaded and in order as before, but this really simplifies asynchronous programming and utilizing asynchronous APIs within your Cake scripts.

    .Does(async () => {
    IFile file = Context.FileSystem.GetFile("./test.txt");
            inputStream = testFile.OpenRead(),
            outputStream = new MemoryStream())
        await inputStream.CopyToAsync(outputStream);
        await outputStream.FlushAsync();
        Information("Copied {0} bytes into memory.",

Reverse task dependencies

Ever wished you could define your task as a dependency of another task - i.e. a reversed dependency relationship? The good news is that you now can.



Since task A is configured to be a dependee of B the task definition will be identical to the following:



Optional or required task dependencies

You can now explicitly specify whether or not a dependency (or dependee) is optional or required. This is useful if you want to create "extension points" in your build script.

Task("Bar").IsDependencyOf("Foo", required: true);
Task("Baz").IsDependencyOf("Qux", required: false)

In the above example, Bar is dependent on Foo while Baz is dependent on Qux. The difference between the two dependencies above is that Cake will throw an exception if no task called Foo was found.

Contributions were included from:

Full details of everything that was included in these releases can be seen below.

As part of this release we had 29 issues closed.

Breaking change

  • #1805 Change GitVersion settings to use nullable integer


  • #1856 Support MSBuild warnaserror and warnasmessage arguments
  • #1821 Missing Cake method for nuget list
  • #1818 Support task dependees (reverse dependencies)
  • #1766 Support for #define
  • #1032 Support async callbacks


  • #1853 using static Directive doesn't compile
  • #1843 NuGetContentResolver should not return ref assemblies.
  • #1842 Params in URI pre-processor directives are case sensitive
  • #1838 Dependencies are installed but have no references added when using LoadDependencies=true with in process nuget client
  • #1831 CleanDirectories Throws NullReferenceException When Token Is Null
  • #1815 Exception Message should be shown rather than "One or more errors occurred."
  • #1404 MsBuildSettings.WithProperty does not escape values


  • #1840 Fix Chocolatey Package
  • #1804 Unable to execute when namespace-less assembly with CakeMethodAlias is referenced
  • #1731 GitLabCI variable changes.
  • #1632 Tasks with long names do not display nicely with showdescription
  • #1607 ToolResolutionStrategy fails unexpectedly with Cake.LongPath.Module
  • #1548 LogExtension colorizes output incorrectly
  • #1547 Escaping curly braces in log messages
  • #787 Reference NuGet dependencies installed via the #addin directive


  • #1835 Fixed typo in installer scripts
  • #1814 Fix typo: envrionment

Cake v0.22.1 and v0.22.2 released

Sunday, September 17, 2017
Release Notes

Version 0.22.1 and 0.22.2 of Cake have been released.

Following the release of Cake 0.22.0 the 13th of September, an issue with the GitVersion alias and deserializing certain integer properties the tools output was uncovered, and the decision was taken to quickly correct it.

A little too quickly, but fortunately David Driscoll caught, reported and supplied a pull request quickly, so huge thanks for that!

In these releases it's corrected in a non breaking way and for the next release these properties will be corrected from integer to nullable integers, which potentially will be a breaking change for anyone using those properties.

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 these releases can be seen below.


Cake v0.22.0 released

Wednesday, September 13, 2017
Release Notes

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:

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:


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:

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.



Friday, August 25, 2017

As some of you may have noticed, the Cake Website has changed to use an SSL Certificate. This is something that has been on our cards for a while, it is just something that we never got around to.


How to debug a Cake addin

Monday, July 31, 2017
How To's

It's no secret, I like Cake. When I have to write a script to build my source code, I use Cake. On my most recent expedition writing a Cake script to publish a UWP application, I noticed Hockey App publish failed, Cake.HockeyApp was throwing an exception.