.NET SDK and dotnet CLI
|
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. |
The .NET SDK is what developers install to build .NET code: the dotnet command-line interface, MSBuild, the C#,
F# and Visual Basic compilers, the NuGet client, the project templates and the MSBuild SDKs
(Microsoft.NET.Sdk and friends). The .NET runtime is what runs the result; an SDK carries one runtime, and a
machine can hold several of each. This group documents the SDK and its CLI at .NET SDK 10.0.402 (2026-10-13,
runtime 10.0.13). .NET 10 is an LTS release, supported until 2028-11-14. The introduction in the C# Reference is
Build and Tooling.
The command structure
Every invocation is driver, command, arguments and options:
dotnet build src/Ledgerline/Ledgerline.csproj --configuration Release
# ^ ^ ^ ^
# driver command argument option
The driver (dotnet, also called the muxer) has two jobs. Given a path to a .dll it runs an application
(dotnet app.dll); given a command it selects an SDK — the newest installed, or the one global.json asks for
(Installing and Selecting
SDKs) — and runs the command from that SDK. dotnet --help shows both halves; the SDK commands of 10.0.402 are:
SDK commands:
build Build a .NET project.
build-server Interact with servers started by a build.
clean Clean build outputs of a .NET project.
format Apply style preferences to a project or solution.
help Opens the reference page in a browser for the specified command.
msbuild Run Microsoft Build Engine (MSBuild) commands.
new Create a new .NET project or file.
nuget Provides additional NuGet commands.
pack Create a NuGet package.
package Search for, add, remove, or list PackageReferences for a .NET project.
publish Publish a .NET project for deployment.
reference Add, remove, or list ProjectReferences for a .NET project.
restore Restore dependencies specified in a .NET project.
run Build and run a .NET project output.
sdk Manage .NET SDK installation.
solution Modify Visual Studio solution files.
store Store the specified assemblies in the runtime package store.
test Run unit tests using the test runner specified in a .NET project.
tool Install or manage tools that extend the .NET experience.
vstest Run Microsoft Test Engine (VSTest) commands.
workload Manage optional workloads.
Additional commands from bundled tools:
dev-certs Create and manage development certificates.
fsi Start F# Interactive / execute F# scripts.
user-jwts Manage JSON Web Tokens in development.
user-secrets Manage development user secrets.
watch Start a file watcher that runs a command when files change.
The .NET 10 SDK lists commands noun first (dotnet package add, dotnet reference add); the older verb-first
forms (dotnet add package) still work but no longer appear in the help
(Solutions, References
and Packages).
Source: .NET CLI overview: Command structure, Driver.
The command groups
| Group | Commands | Page |
|---|---|---|
Basic |
|
the pages below, one per task |
Project modification |
|
|
NuGet |
|
|
Workloads |
|
|
Advanced |
|
|
Tools |
|
What is installed
dotnet --info is the first thing to paste into a bug report: the SDK in use and its MSBuild, the workload state, the
host, every SDK and runtime, and the DOTNET_* variables that are set.
dotnet --info
.NET SDK:
Version: 10.0.402
Commit: a8dd0577c5
Workload version: 10.0.400-manifests.da132f47
MSBuild version: 18.9.15+a8dd0577c
Runtime Environment:
OS Name: ubuntu
OS Version: 24.04
OS Platform: Linux
RID: linux-x64
Base Path: ~/.dotnet/sdk/10.0.402/
.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.
Host:
Version: 10.0.13
Architecture: x64
Commit: 4099f83977
.NET SDKs installed:
9.0.319 [~/.dotnet/sdk]
10.0.402 [~/.dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 9.0.21 [~/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.13 [~/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.32 [~/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 9.0.21 [~/.dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.13 [~/.dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
DOTNET_CLI_TELEMETRY_OPTOUT [1]
DOTNET_NOLOGO [1]
dotnet --list-sdks, dotnet --list-runtimes and dotnet --version print one part each and are easier to parse in
scripts. Note the two different "versions": the SDK (10.0.402) and the host/runtime (10.0.13).
Baseline and release history
| SDK | Change |
|---|---|
.NET 8 |
|
.NET 9 |
Terminal Logger on by default; workload sets, |
.NET 10 |
|
10.0.2xx |
|
10.0.4xx |
deterministic |
.NET 11 (preview) |
MSBuild Server and the NativeAOT CLI host on by default; |
Details, links and support dates are on Versions and Release History. Where a page mentions .NET 11 it refers to SDK 11.0.100-rc.2, a go-live release candidate.
Source: .NET SDK overview.
Reading order
Setting up — Installing and Selecting SDKs, dotnet new and Templates, Solutions, References and Packages.
The inner loop — Restore, Build and Clean, Run and File-Based Apps, dotnet test, Watch and Hot Reload, Format and Code Analysis.
Shipping — dotnet pack, Publish and Deployment Models, Container Images.
Extending the SDK — .NET Tools, Workloads, Authoring Templates.