-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Updated documentation to publish file based application #50904
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,6 +96,35 @@ In the following steps, you'll look at the files created by the publish process. | |
|
|
||
| 1. Enter a name in response to the prompt, and press <kbd>Enter</kbd> to exit. | ||
|
|
||
| ## Publish a file-based (single-file) app | ||
|
|
||
| The default publishing process creates a framework-dependent deployment, which requires | ||
| the .NET runtime to be installed on the target machine. You can also publish a *file-based* | ||
| app as a single executable that includes the .NET runtime. | ||
|
|
||
| To publish a single-file, self-contained app, run the following command: | ||
|
|
||
| ```dotnetcli | ||
| dotnet publish -c Release -r win-x64 --self-contained true /p:PublishSingleFile=true | ||
|
Contributor
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. With file-based apps, I don't think you need to specify all of these options. |
||
| ``` | ||
|
|
||
| Replace win-x64 with the appropriate runtime identifier (RID) for your target platform, | ||
| such as linux-x64 or osx-arm64. | ||
|
|
||
| Inspect the file-based output | ||
|
|
||
| After publishing, the output is located in: | ||
|
Contributor
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. File-based apps is a feature that's only available since .NET 10. The default location of the executable is in an |
||
| bin/Release/net8.0/win-x64/publish/ | ||
|
|
||
| In this folder, you’ll find a single executable file: | ||
|
|
||
| HelloWorld.exe (Windows) | ||
|
|
||
| HelloWorld (Linux or macOS) | ||
|
|
||
| This executable contains the application, its dependencies, and the .NET runtime. You can | ||
| copy this file to another machine and run it without installing .NET. | ||
|
|
||
| ## Additional resources | ||
|
|
||
| - [.NET application publishing overview](../deploying/index.md) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.