Pinning Cake Version

To have deterministic builds it is important that on every build the same version of Cake is used.

When installed as a local tool, Cake will always be restored in the version mentioned in the manifest file.

Make sure to use a fixed version number for Cake.Frosting in the *.csproj file:

<PackageReference Include="Cake.Frosting" Version="0.38.4" />

To update the version of Cake you are using after you have pinned it, all you need to do is update the Cake.Frosting NuGet package to the newer version you would like to use.

  1. Pin version of Cake in the tools/packages.config file:

    <?xml version="1.0" encoding="utf-8"?>
    <packages>
        <package id="Cake" version="0.38.5" />
    </packages>

  2. Commit tools/packages.config file to source control repository.

    This will require some tweaks to your .gitignore file. Below are the tweaks that will be required. The first line says to ignore all files underneath the tool directory. The second says to not ignore the packages.config file.

    tools/*
    !tools/packages.config

To update the version of Cake you are using after you have pinned it, all you need to do is update the version in the packages.config file to the newer version you would like to use.

  1. Pin version of Cake in the tools/packages.config file:

    <?xml version="1.0" encoding="utf-8"?>
    <packages>
        <package id="Cake.CoreCLR" version="0.38.5" />
    </packages>

  2. Commit tools/packages.config file to source control repository.

    This will require some tweaks to your .gitignore file. Below are the tweaks that will be required. The first line says to ignore all files underneath the tool directory. The second says to not ignore the packages.config file.

    tools/*
    !tools/packages.config

To update the version of Cake you are using after you have pinned it, all you need to do is update the version in the packages.config file to the newer version you would like to use.