Skip to content

Conversation

@BartoszKlonowski
Copy link
Contributor

@BartoszKlonowski BartoszKlonowski commented Jan 31, 2026

This pull request fixes #50258, by adding the note about RIDs (specified by -r param) being "ignored" when publishing for the whole solution.
Instead, what is also suggested in the added note, publishing should be done per project regarding specific RIDs details or by specifying RIDs per project using (linked in the note) <RuntimeIdentifiers> property in the config.

I didn't make the note by markdown > [!NOTE], because I wasn't sure about the layout of bullet points already there, so let me know in comments in case this would be a good idea.


Internal previews

📄 File 🔗 Preview link
docs/core/tools/dotnet-publish.md dotnet publish

@BartoszKlonowski BartoszKlonowski requested review from a team and meaghanlewis as code owners January 31, 2026 16:46
@dotnetrepoman dotnetrepoman bot added this to the January 2026 milestone Jan 31, 2026
@dotnet-policy-service dotnet-policy-service bot added dotnet-fundamentals/svc dotnet-cli/subsvc community-contribution Indicates PR is created by someone from the .NET community. labels Jan 31, 2026
Copy link
Contributor

@meaghanlewis meaghanlewis left a comment

Choose a reason for hiding this comment

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

@BartoszKlonowski thanks for your contribution! I think using the markdown note format makes sense. I applied that as a suggestion along with a few others.


Publishes the application for a given runtime. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). For more information, see [.NET application publishing overview](../deploying/index.md). If you use this option, use `--self-contained` or `--no-self-contained` also.

**Note**, that publishing can be done on the *solution* level and on the single *project* level. When publishing from the *solution* level (by specifying optional `<SOLUTION>` parameter or leaving it default) MSBuild first compiles the output into `publish` directory **without** any symbols, which means that later compilations done by MSBuild, based on the initial compilation, will still not include any details for specified `<RUNTIME_IDENTIFIER>`.
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
**Note**, that publishing can be done on the *solution* level and on the single *project* level. When publishing from the *solution* level (by specifying optional `<SOLUTION>` parameter or leaving it default) MSBuild first compiles the output into `publish` directory **without** any symbols, which means that later compilations done by MSBuild, based on the initial compilation, will still not include any details for specified `<RUNTIME_IDENTIFIER>`.
> [!NOTE]
> Publishing can be done on the *solution* level and on the single *project* level. When publishing from the *solution* level by specifying the optional `<SOLUTION>` parameter or leaving it default, MSBuild first compiles the output into the `publish` directory **without** any symbols. This means that later compilations done by MSBuild, based on the initial compilation, will still not include any details for specified `<RUNTIME_IDENTIFIER>`.

Publishes the application for a given runtime. For a list of Runtime Identifiers (RIDs), see the [RID catalog](../rid-catalog.md). For more information, see [.NET application publishing overview](../deploying/index.md). If you use this option, use `--self-contained` or `--no-self-contained` also.

**Note**, that publishing can be done on the *solution* level and on the single *project* level. When publishing from the *solution* level (by specifying optional `<SOLUTION>` parameter or leaving it default) MSBuild first compiles the output into `publish` directory **without** any symbols, which means that later compilations done by MSBuild, based on the initial compilation, will still not include any details for specified `<RUNTIME_IDENTIFIER>`.
<br/>This is expected behavior, and to avoid it either publish for a single project (by specifying optional `<PROJECT>` parameter) regarding your RID, or specify RIDs directly in the project config by adding [`<RuntimeIdentifiers>`](../project-sdk/msbuild-props.md#runtimeidentifiers) property.
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
<br/>This is expected behavior, and to avoid it either publish for a single project (by specifying optional `<PROJECT>` parameter) regarding your RID, or specify RIDs directly in the project config by adding [`<RuntimeIdentifiers>`](../project-sdk/msbuild-props.md#runtimeidentifiers) property.
> This is expected behavior. To avoid this behavior either publish for a single project by specifying the optional `<PROJECT>` parameter for your RID or specify RIDs directly in the project config by adding the [`<RuntimeIdentifiers>`](../project-sdk/msbuild-props.md#runtimeidentifiers) property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Indicates PR is created by someone from the .NET community. dotnet-cli/subsvc dotnet-fundamentals/svc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RuntimeIdentifier argument not working as expected when using dotnet publish on a solution

2 participants