C# Build Automation Cheat Sheet
|
This section documents MSBuild 18.9, the .NET SDK 10.0.402 (with its 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:
Build Automation Tools (MSBuild, dotnet CLI & NuGet) — Build Automation Tools (MSBuild, dotnet CLI & NuGet), How a .NET Build Works, SDK-Style Project Files, Target Frameworks and Runtime Identifiers, Solutions and .slnx, Repository-Wide Configuration, Reproducible and Deterministic Builds, CI Builds and Caching, Supply-Chain Security, Choosing and Combining the Tools, and Ecosystem and Learning Resources.
MSBuild — MSBuild, Project File Anatomy, Properties, Items and Metadata, Property Functions, Item Functions and Transforms, Conditions, Targets and Build Order, Incremental Builds and Batching, Tasks and Built-In Tasks, Inline Tasks, Writing Custom Tasks, Imports and Project SDKs, Customizing the Build, Command-Line Reference, Logging and Binary Logs, Parallel, Graph and Server Builds, BuildCheck, Change Waves and Best Practices, The MSBuild API and MSBuild Locator, Troubleshooting MSBuild, and MSBuild Versions and Release History.
.NET SDK & dotnet CLI — .NET SDK and dotnet CLI, Installing and Selecting SDKs, dotnet new and Templates, Restore, Build and Clean, Run and File-Based Apps, dotnet test: VSTest and Microsoft.Testing.Platform, dotnet pack, Publish and Deployment Models, Container Images, Format and Code Analysis, Watch and Hot Reload, Solutions, References and Packages, .NET Tools, Workloads, Authoring Templates, SDK MSBuild Properties Reference, Environment Variables, Completion and Telemetry, Troubleshooting SDK Errors, and .NET SDK Versions and Release History.
NuGet — NuGet, How Package Installation Works, Package Versions and Ranges, Dependency Resolution, PackageReference, Central Package Management, Lock Files and Locked Mode, nuget.config, Package Sources and Source Mapping, Global Packages and Cache Folders, Package Restore, Auditing Packages for Vulnerabilities, Signed Packages and Trust Policies, Authenticated Feeds and Credential Providers, dotnet package and nuget Commands, nuget.exe, Visual Studio and packages.config, NuGet Server API, Troubleshooting NuGet Errors and Warnings, and NuGet Versions and Release History.
Publishing & Distributing Libraries — Publishing and Distributing Libraries, Designing a Library for NuGet, Package Metadata, README, Icon and License, Creating Packages with dotnet pack, Package Layout and Multi-Targeting, MSBuild Props, Targets, Tasks and Analyzers in Packages, Versioning and Prerelease Packages, Symbols, Source Link and Deterministic Packages, Package Validation and API Compatibility, Signing Packages, Tool and Template Packages, nuget.org Accounts, Organizations and API Keys, Publishing to nuget.org, Trusted Publishing, Private Feeds, CI Release Workflows, Managing Published Packages, Pack and Push Errors, and Release Checklist.