Properties of particular interest to
dotnet publish
:
-
PublishProfile=Properties\PublishProfiles\profile.pubxml
: Use a .pubxml to set publish-related
properties. See
Visual Studio publish profiles (.pubxml) for ASP.NET Core app deployment
for more information.
-
PublishReadyToRun=true
: Compiles application assemblies as ReadyToRun (R2R) format. R2R is a form of
ahead-of-time (AOT) compilation. For more information, see
ReadyToRun images.
Available since .NET Core 3.0 SDK.
-
PublishSingleFile=true
: Packages the app into a platform-specific single-file executable. The executable is
self-extracting and contains all dependencies (including native) that are required to run the app. When the app is first run,
the application is extracted to a directory based on the app name and build identifier. Startup is faster when the application
is run again. The application doesn't need to extract itself a second time unless a new version is used.
For more information about single-file publishing, see the
single-file bundler design document
.
Available since .NET Core 3.0 SDK.
-
PublishTrimmed=true
: Trims unused libraries to reduce the deployment size of an app when publishing a
self-contained executable. For more information, see
Trim self-contained deployments and executables
.
Available since .NET Core 3.0 SDK.
Note that it is recommended to specify all of these, other than
PublishProfile
, in a publish profile rather than
here.