Skip to main content
.NETStandard2.0

Templates for creating Cake projects using Cake.Sdk

Published
Sep 10, 2025
1y ago
Total Downloads
12.3K
12,304

Install

dotnet add package Cake.Template --version 5.0.25253.70-beta
ProductVersions
.NET Standard
netstandard2.0

README

Cake.Template

This package contains templates for creating Cake build scripts and projects using Cake.Sdk.

Templates

Minimal Cake SDK File-based (Requires .NET 10)

  • Short name: cakeminimalfile
  • Description: Creates a trivial Cake build script using the file-based approach with #:sdk Cake.Sdk directive
  • Usage: dotnet new cakeminimalfile

Cake SDK File-based (Requires .NET 10)

  • Short name: cakefile
  • Description: Creates a Cake build script using the file-based approach with #:sdk Cake.Sdk directive
  • Usage: dotnet new cakefile
  • Parameters:
    • --name or -n: The name for the generated cake.cs file. Default: folder name
    • --IncludeExampleProject: Include example project structure with solution, main project and test project. Default: false

Cake SDK Multi-file File-based (Requires .NET 10)

  • Short name: cakemultifile
  • Description: Creates a Cake build script using the multi-file structure approach with #:sdk Cake.Sdk directive
  • Usage: dotnet new cakemultifile
  • Parameters:
    • --name or -n: The name for the generated cake.cs file. Default: folder name

Cake SDK Project-based

  • Short name: cakeproj
  • Description: Creates a Cake build project using the project-based approach with Cake.Sdk
  • Usage: dotnet new cakeproj
  • Parameters:
    • --name or -n: The name for the generated project folder. Default: folder name
    • --Framework: Target framework (net8.0, net9.0, net10.0). Default: net9.0

Cake SDK Global.json

  • Short name: cakeglobaljson
  • Description: Creates a global.json file for Cake projects using Cake.Sdk with version placeholders
  • Usage: dotnet new cakeglobaljson
  • Parameters:
    • --SdkVersion: The .NET SDK version to use. Default: SDK version Cake.Template was built with
    • --CakeSdkVersion: The Cake.Sdk version to use. Default: current package version
Examples

Create a trivial file-based build script (requires .NET 10). This example will simply print 'Hello World!' to the screen at run time. The goal of this example is to demonstrate that dotnet can run a cake script with the help of the Cake SDK:

dotnet new cakeminimalfile

Create a file-based build script (requires .NET 10):

dotnet new cakefile

Create a file-based build script with custom name:

dotnet new cakefile --name build

Create a file-based build script with example project structure:

dotnet new cakefile --IncludeExampleProject true

Create a file-based build script with custom name and example project structure:

dotnet new cakefile --name build --IncludeExampleProject true

Create a multi-file file-based build script (requires .NET 10):

dotnet new cakemultifile

Create a multi-file file-based build script with custom name:

dotnet new cakemultifile --name build

Create a project-based build targeting .NET 8.0:

dotnet new cakeproj --Framework net8.0

Create a project-based build targeting .NET 9.0 (default):

dotnet new cakeproj

Create a project-based build with custom name:

dotnet new cakeproj --name mybuild

Create a global.json file with default versions:

dotnet new cakeglobaljson

Create a global.json file with custom SDK version:

dotnet new cakeglobaljson --SdkVersion 10.0.100-preview.6.25358.103

Create a global.json file with custom name:

dotnet new cakeglobaljson --name myglobal

Changes from Previous Version

No structural changes between v5.0.25225.53-beta and v5.0.25253.70-beta.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 1 target framework; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.