Skip to content

Commit 6394f21

Browse files
authored
Note about computing rids (#30168)
1 parent 7568227 commit 6394f21

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

docs/core/rid-catalog.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: .NET Runtime Identifier (RID) catalog
33
description: Learn about the Runtime Identifier (RID) and how RIDs are used in .NET.
4-
ms.date: 05/18/2022
4+
ms.date: 07/11/2022
55
ms.topic: reference
66
---
77
# .NET RID Catalog
@@ -10,7 +10,7 @@ RID is short for *Runtime Identifier*. RID values are used to identify target pl
1010
They're used by .NET packages to represent platform-specific assets in NuGet packages. The following values are examples of RIDs: `linux-x64`, `ubuntu.14.04-x64`, `win7-x64`, or `osx.10.12-x64`.
1111
For the packages with native dependencies, the RID designates on which platforms the package can be restored.
1212

13-
A single RID can be set in the `<RuntimeIdentifier>` element of your project file. Multiple RIDs can be defined as a semicolon-delimited list in the project file's `<RuntimeIdentifiers>` element. They're also used via the `--runtime` option with the following [.NET CLI commands](./tools/index.md):
13+
A single RID can be set in the [`<RuntimeIdentifier>`](project-sdk/msbuild-props.md#runtimeidentifier) element of your project file. Multiple RIDs can be defined as a semicolon-delimited list in the project file's [`<RuntimeIdentifiers>`](project-sdk/msbuild-props.md#runtimeidentifiers) element. They're also used via the `--runtime` option with the following [.NET CLI commands](./tools/index.md):
1414

1515
- [dotnet build](./tools/dotnet-build.md)
1616
- [dotnet clean](./tools/dotnet-clean.md)
@@ -26,7 +26,7 @@ RIDs that represent concrete operating systems usually follow this pattern: `[os
2626

2727
- `[version]` is the operating system version in the form of a dot-separated (`.`) version number. For example, `15.10`.
2828

29-
- The version **shouldn't** be marketing versions, as they often represent multiple discrete versions of the operating system with varying platform API surface area.
29+
The version **shouldn't** be a marketing version, as marketing versions often represent multiple discrete versions of the operating system with varying platform API surface area.
3030

3131
- `[architecture]` is the processor architecture. For example: `x86`, `x64`, `arm`, or `arm64`.
3232

@@ -68,9 +68,11 @@ All RIDs eventually map back to the root `any` RID.
6868
There are some considerations about RIDs that you have to keep in mind when working with them:
6969

7070
- Don't try to parse RIDs to retrieve component parts.
71-
- Don't build RIDs programmatically.
7271
- Use RIDs that are already defined for the platform.
7372
- The RIDs need to be specific, so don't assume anything from the actual RID value.
73+
- Don't build RIDs programmatically unless absolutely necessary.
74+
75+
Some apps need to compute RIDs programmatically. If so, the computed RIDs must match the catalog exactly, including in casing. RIDs with different casing would cause problems when the OS is case sensitive, for example, Linux, because the value is often used when constructing things like output paths. For example, consider a custom publishing wizard in Visual Studio that relies on information from the solution configuration manager and project properties. If the solution configuration passes an invalid value, for example, `ARM64` instead of `arm64`, it could result in an invalid RID, such as `win-ARM64`.
7476

7577
## Using RIDs
7678

0 commit comments

Comments
 (0)