From e7be7003e0336eeb06c46b3859cccf6dbc9410da Mon Sep 17 00:00:00 2001 From: "Andy De George (from Dev Box)" Date: Wed, 22 Jul 2026 16:57:30 -0700 Subject: [PATCH 1/2] Clean some things up --- docs/core/deploying/index.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/docs/core/deploying/index.md b/docs/core/deploying/index.md index 7165da1e71e00..177ba551d37dc 100644 --- a/docs/core/deploying/index.md +++ b/docs/core/deploying/index.md @@ -58,6 +58,9 @@ dotnet publish -c Release -f net9.0 The default output directory of the [`dotnet publish`](../tools/dotnet-publish.md) command is `./bin///publish/`. For example, `dotnet publish -c Release -f net9.0` publishes to `./bin/Release/net9.0/publish/`. However, you can opt in to a simplified output path and folder structure for all build outputs. For more information, see [Artifacts output layout](../sdk/artifacts-output.md). +> [!IMPORTANT] +> When you skip the build step during publish by passing the `--no-build` parameter, publish with the same configuration you used to build. For example, don't build as a framework-dependent app and then publish as a self-contained app. + ::: zone-end ::: zone pivot="visualstudio" @@ -107,11 +110,9 @@ dotnet publish -c Release -r For a list of runtime identifiers, see [Runtime Identifier (RID) catalog](../rid-catalog.md). -::: zone pivot="cli,vscode" - ## Quick reference -The following table provides quick examples of how to publish your app. +The following table provides quick examples of how to publish your app with the `dotnet` CLI: | Publish Mode | Command | |--|--| @@ -123,9 +124,7 @@ The following table provides quick examples of how to publish your app. | [ReadyToRun deployment](#readytorun-deployment) | `dotnet publish -c Release [-r ] -p:PublishReadyToRun=true` | | [Container deployment](#container-deployment) | `dotnet publish -c Release [-r ] -t:PublishContainer` | -::: zone-end - -## Framework-dependent deployment +## Publish as framework-dependent Framework-dependent deployment is the default mode when you publish from either the CLI or Visual Studio. In this mode, a platform-specific executable is created that can be used to start your app. The platform-specific executable is named something similar to `myapp.exe` on Windows or just `myapp` on other platforms. @@ -247,7 +246,7 @@ dotnet publish -c Release -p:UseAppHost=false ::: zone-end -## Self-contained deployment +## Publish as self-contained When you publish a self-contained deployment (SCD), the publishing process creates a platform-specific executable. Publishing an SCD includes all required .NET files to run your app but it doesn't include the native dependencies of .NET. These dependencies must be present on the environment before the app runs. @@ -296,7 +295,7 @@ dotnet publish -c Release -r --self-contained true ::: zone-end -## Single-file deployment +## Publish as single-file When you publish your app as a single-file deployment, all application-dependent files are bundled into a single binary. This deployment model is available for both framework-dependent and self-contained applications, providing an attractive option to deploy and distribute your application as a single file. @@ -349,7 +348,7 @@ dotnet publish -c Release -r -p:PublishSingleFile=true ::: zone-end -## Native AOT deployment +## Publish as native AOT Native AOT deployment compiles your app directly to native code, eliminating the need for a runtime. This publishing option uses **self-contained deployment** mode, as the compiled native code must include everything needed to run the application. This results in faster startup times and reduced memory usage, but comes with some limitations on supported features. @@ -411,7 +410,7 @@ For more information about Native AOT deployment, see [Native AOT deployment](na ::: zone-end -## ReadyToRun deployment +## Publish as ReadyToRun When you publish your app with ReadyToRun compilation, your application assemblies are compiled as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation that improves startup performance by reducing the amount of work the just-in-time (JIT) compiler needs to do as your application loads. This publishing option can be used with both **framework-dependent** and **self-contained** deployment modes. From 4010b53fd3b6feffb121f689248b9fbf07bb7475 Mon Sep 17 00:00:00 2001 From: "Andy De George (from Dev Box)" Date: Wed, 22 Jul 2026 17:23:14 -0700 Subject: [PATCH 2/2] build errors --- docs/core/deploying/index.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/core/deploying/index.md b/docs/core/deploying/index.md index 177ba551d37dc..d60a5b7399326 100644 --- a/docs/core/deploying/index.md +++ b/docs/core/deploying/index.md @@ -59,7 +59,7 @@ dotnet publish -c Release -f net9.0 The default output directory of the [`dotnet publish`](../tools/dotnet-publish.md) command is `./bin///publish/`. For example, `dotnet publish -c Release -f net9.0` publishes to `./bin/Release/net9.0/publish/`. However, you can opt in to a simplified output path and folder structure for all build outputs. For more information, see [Artifacts output layout](../sdk/artifacts-output.md). > [!IMPORTANT] -> When you skip the build step during publish by passing the `--no-build` parameter, publish with the same configuration you used to build. For example, don't build as a framework-dependent app and then publish as a self-contained app. +> When you skip the build step during publish by passing the `--no-build` parameter, use the same options you used when you built the app, including target framework and build mode. For example, don't build as a framework-dependent app and then publish as a self-contained app. ::: zone-end @@ -116,14 +116,16 @@ The following table provides quick examples of how to publish your app with the | Publish Mode | Command | |--|--| -| [Framework-dependent deployment](#framework-dependent-deployment) | `dotnet publish -c Release [-r ]` | -| [Framework-dependent deployment (DLL)](#framework-dependent-deployment) | `dotnet publish -c Release -p:UseAppHost=false` | -| [Self-contained deployment](#self-contained-deployment) | `dotnet publish -c Release [-r ] --self-contained true` | -| [Single-file deployment](#single-file-deployment) | `dotnet publish -c Release [-r ] -p:PublishSingleFile=true` | -| [Native AOT deployment](#native-aot-deployment) | `dotnet publish -c Release [-r ] -p:PublishAot=true` | -| [ReadyToRun deployment](#readytorun-deployment) | `dotnet publish -c Release [-r ] -p:PublishReadyToRun=true` | +| [Framework-dependent deployment](#publish-as-framework-dependent) | `dotnet publish -c Release [-r ]` | +| [Framework-dependent deployment (DLL)](#cross-platform-dll-deployment) | `dotnet publish -c Release -p:UseAppHost=false` | +| [Self-contained deployment](#publish-as-self-contained) | `dotnet publish -c Release [-r ] --self-contained true` | +| [Single-file deployment](#publish-as-single-file) | `dotnet publish -c Release [-r ] -p:PublishSingleFile=true` | +| [Native AOT deployment](#publish-as-native-aot) | `dotnet publish -c Release [-r ] -p:PublishAot=true` | +| [ReadyToRun deployment](#publish-as-readytorun) | `dotnet publish -c Release [-r ] -p:PublishReadyToRun=true` | | [Container deployment](#container-deployment) | `dotnet publish -c Release [-r ] -t:PublishContainer` | + + ## Publish as framework-dependent Framework-dependent deployment is the default mode when you publish from either the CLI or Visual Studio. In this mode, a platform-specific executable is created that can be used to start your app. The platform-specific executable is named something similar to `myapp.exe` on Windows or just `myapp` on other platforms. @@ -246,6 +248,8 @@ dotnet publish -c Release -p:UseAppHost=false ::: zone-end + + ## Publish as self-contained When you publish a self-contained deployment (SCD), the publishing process creates a platform-specific executable. Publishing an SCD includes all required .NET files to run your app but it doesn't include the native dependencies of .NET. These dependencies must be present on the environment before the app runs. @@ -295,6 +299,8 @@ dotnet publish -c Release -r --self-contained true ::: zone-end + + ## Publish as single-file When you publish your app as a single-file deployment, all application-dependent files are bundled into a single binary. This deployment model is available for both framework-dependent and self-contained applications, providing an attractive option to deploy and distribute your application as a single file. @@ -348,6 +354,8 @@ dotnet publish -c Release -r -p:PublishSingleFile=true ::: zone-end + + ## Publish as native AOT Native AOT deployment compiles your app directly to native code, eliminating the need for a runtime. This publishing option uses **self-contained deployment** mode, as the compiled native code must include everything needed to run the application. This results in faster startup times and reduced memory usage, but comes with some limitations on supported features. @@ -410,6 +418,8 @@ For more information about Native AOT deployment, see [Native AOT deployment](na ::: zone-end + + ## Publish as ReadyToRun When you publish your app with ReadyToRun compilation, your application assemblies are compiled as ReadyToRun (R2R) format. R2R is a form of ahead-of-time (AOT) compilation that improves startup performance by reducing the amount of work the just-in-time (JIT) compiler needs to do as your application loads. This publishing option can be used with both **framework-dependent** and **self-contained** deployment modes.