Jeffrey Goldman Jeffrey Goldman - 2 months ago 33x
C# Question

How do I fetch Cake Build prerelease addin from alternative source?

We're creating an internal use Cake addin for our build scripts.

We're currently publishing it as pre-release to an internal feed, we've previously consumed addins from NuGet with

#addin [id]
syntax like this:

#addin "Cake.FileHelpers"

Is it possible to change the default feed or specify the feed in any way? And is there a way to indicate that pre-release is allowed?


As stated on the Preprocessor directives page on, the #addin directive also supports an URI syntax (#addin nuget:[uri]?package=packageid[&parameters] ) which can be used to specify parameters like feed, version & prerelease.

Example usage:

#addin nuget:?package=Cake.Foo
#addin nuget:?package=Cake.Foo&version=1.2.3
#addin nuget:?package=Cake.Foo&prerelease
#addin nuget:

You can also override the default nuget location for all addins by specifying the NUGET_SOURCE environment variable, the --nuget_source argument to Cake or adding a config file like below


You save it as cake.config and place it along your build.cake file. You can read more about Cake configuration here and the default values here

But to fetch latest prerelease version I would suggest going with #addin nuget:[feedurl]?package=[packageid]&prerelease syntax.