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

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
```

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:
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