Skip to content

Commit 6affae8

Browse files
authored
expand rid graph examples (#40285)
1 parent 8eaee62 commit 6affae8

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

docs/core/compatibility/sdk/8.0/rid-graph.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Breaking change: .NET SDK uses a smaller RID graph"
33
description: Learn about a breaking change in the .NET 8 SDK where the SDK uses a smaller, portable RID graph for projects that target .NET 8 or later.
4-
ms.date: 09/05/2023
4+
ms.date: 04/01/2024
55
---
66
# .NET SDK uses a smaller RID graph
77

@@ -13,7 +13,9 @@ The .NET SDK used a complex [RID graph](../../../rid-catalog.md) to determine as
1313

1414
## New behavior
1515

16-
Starting in .NET 8, the .NET SDK uses a smaller graph consisting of only portable RIDs, for projects that target .NET 8 or a later version. This means that the SDK won't recognize version-specific or distro-specific RIDs by default.
16+
Starting in .NET 8, the .NET SDK uses a smaller graph consisting of only portable RIDs, for projects that target .NET 8 or a later version. This means that the SDK won't recognize version-specific or distro-specific RIDs by default. You might see the following error (or similar) when you build your project:
17+
18+
> error NETSDK1083: The specified RuntimeIdentifier 'win10-x64' is not recognized. See <https://aka.ms/netsdk1083> for more information.
1719
1820
## Version introduced
1921

@@ -29,11 +31,29 @@ The RID graph was costly to maintain and understand, requiring .NET itself to be
2931

3032
## Recommended action
3133

32-
Use portable RIDs, for example, `linux-<arch>`, `linux-musl-<arch>`, `osx-<arch>`, and `win-<arch>`.
34+
Use portable RIDs, for example, `linux-<arch>`, `linux-musl-<arch>`, `osx-<arch>`, and `win-<arch>`, instead of version-specific or distro-specific RIDs, such as `ubuntu.16.04-<arch>`, `osx.10.11-<arch>`, and `win10-<arch>`.
35+
36+
If you specify the RID by using the [RuntimeIdentifier](../../../project-sdk/msbuild-props.md#runtimeidentifier) MSBuild property in your project file (\*.csproj, \*.vbproj, or \*.fsproj), change it accordingly. For example, change `<RuntimeIdentifier>win10-x64</RuntimeIdentifier>` to `<RuntimeIdentifier>win-x64</RuntimeIdentifier>` in your project file:
37+
38+
```xml
39+
<PropertyGroup>
40+
...
41+
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
42+
</PropertyGroup>
43+
```
44+
45+
If you specify the RID as a command-line argument, make a similar change. For example, instead of `dotnet publish --framework net8.0 --runtime win10-x64`, use the command `dotnet publish --framework net8.0 --runtime win-x64`.
3346

3447
If you need to revert to the previous behavior of using the old, full RID graph, you can set the `UseRidGraph` MSBuild property to `true` in your project file. However, the old RID graph won't be updated in the future to attempt to handle any other distros or architectures.
3548

49+
```xml
50+
<PropertyGroup>
51+
<UseRidGraph>true</UseRidGraph>
52+
</PropertyGroup>
53+
```
54+
3655
## See also
3756

57+
- [NETSDK1083: The specified RuntimeIdentifier is not recognized](../../../tools/sdk-errors/netsdk1083.md)
3858
- [Host determines RID-specific assets](../../deployment/8.0/rid-asset-list.md)
3959
- [RuntimeIdentifier returns platform for which the runtime was built](../../core-libraries/8.0/runtimeidentifier.md)

docs/core/tools/sdk-errors/netsdk1083.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "NETSDK1083: The specified RuntimeIdentifier is not recognized"
33
description: Learn about .NET SDK error NETSDK1083, which warns about an unknown runtime identifier.
44
ms.topic: error-reference
5-
ms.date: 09/19/2023
5+
ms.date: 04/01/2024
66
f1_keywords:
77
- NETSDK1083
88
---
@@ -12,4 +12,10 @@ NETSDK1083 warns you that the [runtime identifier](../../rid-catalog.md) (RID) s
1212

1313
To resolve this error, specify a known RID as your project's `RuntimeIdentifier`.
1414

15-
In .NET 8 and later versions, the default behavior of the .NET SDK is to [use a smaller portable RID graph](../../compatibility/sdk/8.0/rid-graph.md). If your project uses a version-specific or distro-specific RID, switch to a portable RID. If you need to revert to the previous behavior of using the old, full RID graph, you can set the `UseRidGraph` MSBuild property to `true` in your project file. The old RID graph is no longer updated and exists only for backwards compatibility, and the option to use it might be removed in a future release.
15+
In .NET 8 and later versions, the default behavior of the .NET SDK is to [use a smaller portable RID graph](../../compatibility/sdk/8.0/rid-graph.md). If your project uses a version-specific or distro-specific RID, switch to a portable RID. For example, if your project file contains the property `<RuntimeIdentifier>win10-x64</RuntimeIdentifier>`, change it to `<RuntimeIdentifier>win-x64</RuntimeIdentifier>`.
16+
17+
If you need to revert to the previous behavior of using the old, full RID graph, you can set the `UseRidGraph` MSBuild property to `true` in your project file. The old RID graph is no longer updated and exists only for backwards compatibility, and the option to use it might be removed in a future release.
18+
19+
## See also
20+
21+
- [.NET SDK uses a smaller RID graph](../../compatibility/sdk/8.0/rid-graph.md)

0 commit comments

Comments
 (0)