Xake.Dotnet 4.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Xake.Dotnet --version 4.0.0
                    
NuGet\Install-Package Xake.Dotnet -Version 4.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Xake.Dotnet" Version="4.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Xake.Dotnet" Version="4.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Xake.Dotnet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Xake.Dotnet --version 4.0.0
                    
#r "nuget: Xake.Dotnet, 4.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Xake.Dotnet@4.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Xake.Dotnet&version=4.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Xake.Dotnet&version=4.0.0
                    
Install as a Cake Tool

The .NET tasks of Xake, a make utility for .NET in F# inspired by shake: csc, fsc, msbuild, resgen, resourceset and project descriptions (Xake.Dotnet), and reproducible builds (lock files, restore, SBOM, verification, packing and signing; Xake.Hermetic.Dotnet). Both assemblies ship in this one package, which depends on the engine package Xake, so one reference is enough:

#r "nuget: Xake.Dotnet, 4.0.0"   // brings Xake too

Until Xake 3.x the .NET tasks shipped inside the Xake package and the hermetic part was the package Xake.Hermetic.Dotnet (ended at 0.10.0). From 4.0 a script adds the line above; a script that referenced Xake.Hermetic.Dotnet replaces that line with it. open Xake.Dotnet and open Xake.Hermetic.Dotnet are unchanged.

See Xake documentation for the engine and the task reference for the full set of options.

Prerequisites

The .NET SDK 8.0+ (see global.json). Nothing else: the compilers come from the SDK and the .NET Framework reference assemblies from the Microsoft.NETFramework.ReferenceAssemblies.* packages, restored on first use -- so full-framework binaries can be built on any OS without a Framework installation.

Csc task

The simple script looks like:

#r "nuget: Xake.Dotnet"

open Xake
open Xake.Dotnet

do xakeScript {
  rules [
    "main" <== ["helloworld.exe"]

    "helloworld.exe" ..> csc {src !!"helloworld.cs"}
  ]
}

This script compiles helloworld assembly from helloworld.cs file. See samples/fullframework.fsx for targeting a specific framework, and docs/dotnet-build.md for how the toolchain is discovered and how to switch between the SDK, a Framework installation and Mono.

csc also takes toolset "<version>" (a pinned Microsoft.Net.Compilers.Toolset, see samples/toolset.fsx), noserver/keepalive (compiler server; the script variable CSC_SERVER sets it for the whole script) and resolve (returns the resolved Csc for Csc.run instead of compiling). From record syntax use Csc.compile settings. All of it is in docs/tasks.md.

Reproducible builds (Xake.Hermetic.Dotnet)

API may change. The hermetic part is still settling: until this note is removed, an incompatible change in it is a minor version of this package, with a release-notes line.

open Xake.Hermetic.Dotnet adds what a build needs to be repeatable and auditable: a lock file that records exactly what the compiler is handed, with the SHA-256 of every reference, analyzer and the compiler itself; a restore of the packages that lock names; an SBOM generated from the lock; and the release steps after the compile. C# and F# alike, from csc {}/fsc {} or from an imported .csproj/.fsproj. With HERMETIC=on a lock that names anything outside the checkout and the build's package folder, other than an exactly pinned .NET SDK, is neither written nor replayed.

Compile gated by a lock (recorded on the first build, enforced afterwards):

"out/app.dll" ..> csc { targetfwk "net472"; src !!"src/*.cs"; lock "locks/app.json" }

An F# library, gated the same way (the compiler is the SDK's fsc.dll: pin the SDK in global.json):

"out/lib.dll" ..> fsc { targetfwk "net8.0"; src !!"src/*.fs"; lock "locks/lib.json" }

Restore the packages a lock names, checked against their recorded sha512:

let! doc = Lock.load "locks/app.json"
do! Lock.restore Restore.Options.Default doc

See docs/hermetic/README.md for the lock format, Project.import (locks from existing project files), SBOMs, verification, packing and signing, and src/hermetic/readme.md for more examples.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 is compatible.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0 0 11/21/2026
5.0.0-preview.1 54 11/19/2026
4.4.0 77 11/19/2026
4.4.0-preview.2 45 11/19/2026
4.4.0-preview.1 46 11/19/2026
4.3.0 105 11/8/2026
4.2.0 104 11/7/2026
4.1.0 100 11/6/2026
4.0.0 101 11/3/2026
4.0.0-preview.1 115 11/3/2026
1.1.4.7-beta 1,685 5/15/2018
1.1.0.4-alpha 1,350 5/13/2018
1.1.0.2-alpha 1,375 5/13/2018