From 0fe968d5f0790ed7ff9551ef8b4155e9f7a3e88b Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 11 Jul 2022 12:18:30 -0700 Subject: [PATCH 1/2] computing rids --- docs/core/rid-catalog.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/core/rid-catalog.md b/docs/core/rid-catalog.md index dd56d11caf5f5..d106af74a97fb 100644 --- a/docs/core/rid-catalog.md +++ b/docs/core/rid-catalog.md @@ -1,7 +1,7 @@ --- title: .NET Runtime Identifier (RID) catalog description: Learn about the Runtime Identifier (RID) and how RIDs are used in .NET. -ms.date: 05/18/2022 +ms.date: 07/11/2022 ms.topic: reference --- # .NET RID Catalog @@ -10,7 +10,7 @@ RID is short for *Runtime Identifier*. RID values are used to identify target pl 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`. For the packages with native dependencies, the RID designates on which platforms the package can be restored. -A single RID can be set in the `` element of your project file. Multiple RIDs can be defined as a semicolon-delimited list in the project file's `` element. They're also used via the `--runtime` option with the following [.NET CLI commands](./tools/index.md): +A single RID can be set in the [](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 [](project-sdk/msbuild-props.md#runtimeidentifiers) element. They're also used via the `--runtime` option with the following [.NET CLI commands](./tools/index.md): - [dotnet build](./tools/dotnet-build.md) - [dotnet clean](./tools/dotnet-clean.md) @@ -26,7 +26,7 @@ RIDs that represent concrete operating systems usually follow this pattern: `[os - `[version]` is the operating system version in the form of a dot-separated (`.`) version number. For example, `15.10`. - - The version **shouldn't** be marketing versions, as they often represent multiple discrete versions of the operating system with varying platform API surface area. + The version **shouldn't** be a marketing version, as they often represent multiple discrete versions of the operating system with varying platform API surface area. - `[architecture]` is the processor architecture. For example: `x86`, `x64`, `arm`, or `arm64`. @@ -68,9 +68,11 @@ All RIDs eventually map back to the root `any` RID. There are some considerations about RIDs that you have to keep in mind when working with them: - Don't try to parse RIDs to retrieve component parts. -- Don't build RIDs programmatically. - Use RIDs that are already defined for the platform. - The RIDs need to be specific, so don't assume anything from the actual RID value. +- Don't build RIDs programmatically unless absolutely necessary. + + 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`. ## Using RIDs From 6fb0e684a109a356b3a2c72bda64134f931c51f3 Mon Sep 17 00:00:00 2001 From: Genevieve Warren <24882762+gewarren@users.noreply.github.com> Date: Mon, 11 Jul 2022 14:08:50 -0700 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Tom Dykstra --- docs/core/rid-catalog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/core/rid-catalog.md b/docs/core/rid-catalog.md index d106af74a97fb..bebf6d3dcd420 100644 --- a/docs/core/rid-catalog.md +++ b/docs/core/rid-catalog.md @@ -10,7 +10,7 @@ RID is short for *Runtime Identifier*. RID values are used to identify target pl 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`. For the packages with native dependencies, the RID designates on which platforms the package can be restored. -A single RID can be set in the [](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 [](project-sdk/msbuild-props.md#runtimeidentifiers) element. They're also used via the `--runtime` option with the following [.NET CLI commands](./tools/index.md): +A single RID can be set in the [``](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 [``](project-sdk/msbuild-props.md#runtimeidentifiers) element. They're also used via the `--runtime` option with the following [.NET CLI commands](./tools/index.md): - [dotnet build](./tools/dotnet-build.md) - [dotnet clean](./tools/dotnet-clean.md) @@ -26,7 +26,7 @@ RIDs that represent concrete operating systems usually follow this pattern: `[os - `[version]` is the operating system version in the form of a dot-separated (`.`) version number. For example, `15.10`. - The version **shouldn't** be a marketing version, as they often represent multiple discrete versions of the operating system with varying platform API surface area. + 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. - `[architecture]` is the processor architecture. For example: `x86`, `x64`, `arm`, or `arm64`.