Skip to content
Draft
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions docs/core/deploying/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: .NET application publishing overview
description: Learn about the ways to publish a .NET application. .NET can publish platform-specific or cross-platform apps. You can publish an app as self-contained or as framework-dependent. Each mode affects how a user runs your app.
author: adegeo
ms.author: adegeo
ms.date: 08/11/2025
ms.date: 11/23/2026
ms.custom: updateeachrelease
ai-usage: ai-assisted
zone_pivot_groups: development-environment-one
Expand Down Expand Up @@ -167,10 +167,10 @@ dotnet publish -c Release [-r <RID>]
Or explicitly:

```dotnetcli
dotnet publish -c Release [-r <RID>] --self-contained false
dotnet publish -c Release [-r <RID>] --no-self-contained
```

- `--self-contained false`
- `--no-self-contained`

This switch explicitly tells the .NET SDK to create a framework-dependent deployment.

Expand Down
14 changes: 8 additions & 6 deletions docs/core/deploying/single-file/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Create a single file for application deployment
description: Learn what single file application is and why you should consider using this application deployment model.
author: lakshanf
ms.date: 03/25/2026
ms.date: 11/23/2026
ms.custom: kr2b-contr-experiment
ai-usage: ai-assisted
---
Expand All @@ -25,7 +25,7 @@ Here's a sample project file that specifies single file publishing:

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net11.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
Expand All @@ -38,7 +38,7 @@ These properties have the following functions:

- `PublishSingleFile`. Enables single file publishing. Also enables single file warnings during `dotnet build`.
- `SelfContained`. Determines whether the app is self-contained or framework-dependent.
- `RuntimeIdentifier`. Specifies the [OS and CPU type](../../rid-catalog.md) you're targeting. Also sets `<SelfContained>true</SelfContained>` by default.
- `RuntimeIdentifier`. Specifies the [OS and CPU type](../../rid-catalog.md) you're targeting. For apps targeting .NET 7 or earlier, it also implies `SelfContained` unless you explicitly set that property.

Single file apps are always OS and architecture specific. You need to publish for each configuration, such as Linux x64, Linux Arm64, Windows x64, and so forth.

Expand All @@ -64,18 +64,20 @@ Publish a single file application using the [dotnet publish](../../tools/dotnet-

The following example publishes the app for Windows as a self-contained single file application.

`dotnet publish -r win-x64`
`dotnet publish -r win-x64 --self-contained`

The following example publishes the app for Linux as a framework dependent single file application.

`dotnet publish -r linux-x64 --self-contained false`
`dotnet publish -r linux-x64 -p:SelfContained=false`

`<PublishSingleFile>` should be set in the project file to enable file analysis during build, but it's also possible to pass these options as `dotnet publish` arguments:

```dotnetcli
dotnet publish -r linux-x64 -p:PublishSingleFile=true --self-contained false
dotnet publish -r linux-x64 -p:PublishSingleFile=true -p:SelfContained=false
```

For apps targeting .NET 8 or later, `PublishSingleFile` implies a self-contained publish unless you specify otherwise. To publish a framework-dependent app, set `SelfContained` to `false` as shown, or use `--no-self-contained`. A compatible .NET runtime must be installed on the target machine.

For more information, see [.NET application publishing overview](../../deploying/index.md).

# [Visual Studio](#tab/vs)
Expand Down
10 changes: 4 additions & 6 deletions docs/core/tools/dotnet-publish.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: dotnet publish command
description: The dotnet publish command publishes a .NET project or solution to a directory.
ms.date: 09/24/2025
ms.date: 11/23/2026
---
# dotnet publish

Expand Down Expand Up @@ -232,18 +232,16 @@ For more information, see the following resources:
- Create a [self-contained executable](../deploying/index.md#publish-as-self-contained) for the project in the current directory, for a specific runtime:

```dotnetcli
dotnet publish --runtime osx-x64
dotnet publish --runtime osx-x64 --self-contained
```

The RID must be in the project file.

- Create a [framework-dependent executable](../deploying/index.md#publish-as-framework-dependent) for the project in the current directory, for a specific platform:

```dotnetcli
dotnet publish --runtime osx-x64 --self-contained false
dotnet publish --runtime osx-x64 --no-self-contained
```

The RID must be in the project file. This example applies to .NET Core 3.0 SDK and later versions.
This example applies to .NET Core 3.0 SDK and later versions.

- Publish the project in the current directory, for a specific runtime and target framework:

Expand Down
2 changes: 1 addition & 1 deletion docs/core/whats-new/dotnet-8/containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RUN dotnet restore -a $TARGETARCH

# Copy everything else and build app.
COPY aspnetapp/. .
RUN dotnet publish -a $TARGETARCH --self-contained false --no-restore -o /app
RUN dotnet publish -a $TARGETARCH --no-self-contained --no-restore -o /app
```

For more information, see the [Improving multi-platform container support](https://devblogs.microsoft.com/dotnet/improving-multiplatform-container-support/) blog post.
Expand Down
Loading