C# Build Automation Cheat Sheet

This section documents MSBuild 18.9, the .NET SDK 10.0.402 (with its dotnet CLI) and NuGet 7.9, as published in the MSBuild, .NET and NuGet documentation on learn.microsoft.com, which is the reference these pages are written and verified against. Material about .NET 11 / NuGet 8.0 is still in preview and is always flagged as such — never presented as baseline.

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

The C# Reference bibliography lists the reference material consulted while preparing these pages.

A single-page, A4-landscape summary of the build automation section — the five stages of a build, a global.json and an SDK-style project with the Directory.* files, MSBuild’s $(), @() and %() syntax with a target skeleton, the MSBuild switches worth remembering and the classic MSBuild bugs, the everyday dotnet commands and .NET tools, PackageReference version ranges and asset control, Central Package Management, a nuget.config with package source mapping, the restore errors you will meet, and the publishing essentials: library metadata and validation properties, package folders, dotnet nuget push and Trusted Publishing, unlisting and deprecating, and the pack errors. A "then → now" strip along the bottom maps the older practices to their current replacements: packages.config to PackageReference, .sln to .slnx, PackageIconUrl to PackageIcon, PackageLicenseUrl to PackageLicenseExpression, .symbols.nupkg to .snupkg, the Source Link package to the SDK’s built-in Source Link, dotnet add package to dotnet package add, long-lived API keys to Trusted Publishing, VSTest to Microsoft.Testing.Platform, and dotnet tool install plus a run to dnx. It reflects MSBuild 18.9, .NET SDK 10.0.402 and NuGet 7.9.0, verified on 2026-10-23. For the language itself, see the C# Cheat Sheet.

For the full explanation, every option, and additional examples, see the dedicated pages: