Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/core/tutorials/publishing-with-visual-studio-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Publish a file-based (single-file) app
## Publish a file-based 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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:
Copy link
Contributor

Choose a reason for hiding this comment

The 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 artifacts directory next to the .cs file: https://learn.microsoft.com/dotnet/core/sdk/file-based-apps

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)
Expand Down