-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Clean some things up in the publishing article #55003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
adegeo
wants to merge
2
commits into
main
Choose a base branch
from
adegeo/47080/deploy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+24
−15
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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/<BUILD-CONFIGURATION>/<TFM>/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, 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 | ||
|
|
||
| ::: zone pivot="visualstudio" | ||
|
|
@@ -107,25 +110,23 @@ dotnet publish -c Release -r <RID> | |
|
|
||
| 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 | | ||
| |--|--| | ||
| | [Framework-dependent deployment](#framework-dependent-deployment) | `dotnet publish -c Release [-r <RID>]` | | ||
| | [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 <RID>] --self-contained true` | | ||
| | [Single-file deployment](#single-file-deployment) | `dotnet publish -c Release [-r <RID>] -p:PublishSingleFile=true` | | ||
| | [Native AOT deployment](#native-aot-deployment) | `dotnet publish -c Release [-r <RID>] -p:PublishAot=true` | | ||
| | [ReadyToRun deployment](#readytorun-deployment) | `dotnet publish -c Release [-r <RID>] -p:PublishReadyToRun=true` | | ||
| | [Framework-dependent deployment](#publish-as-framework-dependent) | `dotnet publish -c Release [-r <RID>]` | | ||
| | [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 <RID>] --self-contained true` | | ||
| | [Single-file deployment](#publish-as-single-file) | `dotnet publish -c Release [-r <RID>] -p:PublishSingleFile=true` | | ||
| | [Native AOT deployment](#publish-as-native-aot) | `dotnet publish -c Release [-r <RID>] -p:PublishAot=true` | | ||
| | [ReadyToRun deployment](#publish-as-readytorun) | `dotnet publish -c Release [-r <RID>] -p:PublishReadyToRun=true` | | ||
| | [Container deployment](#container-deployment) | `dotnet publish -c Release [-r <RID>] -t:PublishContainer` | | ||
|
|
||
| ::: zone-end | ||
| <a id="framework-dependent-deployment"></a> | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you adding bookmarks manually? |
||
|
|
||
| ## 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 +248,9 @@ dotnet publish -c Release -p:UseAppHost=false | |
|
|
||
| ::: zone-end | ||
|
|
||
| ## Self-contained deployment | ||
| <a id="self-contained-deployment"></a> | ||
|
|
||
| ## 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 +299,9 @@ dotnet publish -c Release -r <RID> --self-contained true | |
|
|
||
| ::: zone-end | ||
|
|
||
| ## Single-file deployment | ||
| <a id="single-file-deployment"></a> | ||
|
|
||
| ## 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 +354,9 @@ dotnet publish -c Release -r <RID> -p:PublishSingleFile=true | |
|
|
||
| ::: zone-end | ||
|
|
||
| ## Native AOT deployment | ||
| <a id="native-aot-deployment"></a> | ||
|
|
||
| ## 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 +418,9 @@ For more information about Native AOT deployment, see [Native AOT deployment](na | |
|
|
||
| ::: zone-end | ||
|
|
||
| ## ReadyToRun deployment | ||
| <a id="readytorun-deployment"></a> | ||
|
|
||
| ## 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. | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.