dotnet-publish
deployment package builder and publisher
TLDR
Publish for deployment
SYNOPSIS
dotnet publish [project] [options]
DESCRIPTION
dotnet publish compiles and packages an application for deployment. It produces a directory containing the application, dependencies, and optionally the .NET runtime itself.
Self-contained deployment includes the runtime, eliminating target machine .NET requirements. Framework-dependent deployment assumes .NET is installed, producing smaller output.
Advanced options like single-file publishing and trimming optimize output for specific deployment scenarios.
PARAMETERS
PROJECT
Project or solution to publish.-c, --configuration CONFIG
Build configuration.-r, --runtime RID
Target runtime identifier.--self-contained [BOOL]
Include .NET runtime.-o, --output DIR
Output directory.-p:PROP=VALUE
Set MSBuild property.--no-build
Skip build, use existing output.--help
Display help information.
CAVEATS
Self-contained apps are larger. Trimming may remove needed code. Runtime identifiers must match target system. Cross-platform publishing may need additional SDKs.
HISTORY
dotnet publish is part of the .NET CLI, providing standardized deployment artifact creation across platforms. It replaced platform-specific deployment methods in legacy .NET.
SEE ALSO
dotnet(1), dotnet-build(1), dotnet-run(1)
