Skip to content

Commit 8cfe70f

Browse files
authored
Core libraries breaking changes for RC 1 (#36992)
1 parent 054611e commit 8cfe70f

File tree

5 files changed

+99
-0
lines changed

5 files changed

+99
-0
lines changed

docs/core/compatibility/8.0.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,13 @@ If you're migrating an app to .NET 8, the breaking changes listed here might aff
5050
| [FileStream writes when pipe is closed](core-libraries/8.0/filestream-disposed-pipe.md) | Behavioral change | Preview 1 |
5151
| [GC.GetGeneration might return Int32.MaxValue](core-libraries/8.0/getgeneration-return-value.md) | Behavioral change | Preview 4 |
5252
| [GetFolderPath behavior on Unix](core-libraries/8.0/getfolderpath-unix.md) | Behavioral change | Preview 1 |
53+
| [GetSystemVersion no longer returns ImageRuntimeVersion](core-libraries/8.0/getsystemversion.md) | Behavioral change | RC 1 |
5354
| [IndexOfAnyValues renamed to SearchValues](core-libraries/8.0/indexofanyvalues-renamed.md) | Source/binary incompatible | Preview 5 |
5455
| [ITypeDescriptorContext nullable annotations](core-libraries/8.0/itypedescriptorcontext-props.md) | Source incompatible | Preview 1 |
5556
| [Legacy Console.ReadKey removed](core-libraries/8.0/console-readkey-legacy.md) | Behavioral change | Preview 1 |
5657
| [Method builders generate parameters with HasDefaultValue set to false](core-libraries/8.0/parameterinfo-hasdefaultvalue.md) | Behavioral change | Preview 5 |
5758
| [Removed overloads of ToFrozenDictionary/ToFrozenSet](core-libraries/8.0/optimizeforreading-arg.md) | Source/binary incompatible | Preview 7 |
59+
| [RuntimeIdentifier returns platform for which runtime was built](core-libraries/8.0/runtimeidentifier.md) | Behavioral change | RC 1 |
5860

5961
## Cryptography
6062

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
title: ".NET 8 breaking change: GetSystemVersion no longer returns ImageRuntimeVersion"
3+
description: Learn about the .NET 8 breaking change in core .NET libraries where RuntimeEnvironment.GetSystemVersion no longer returns ImageRuntimeVersion, which is a .NET Framework-oriented value.
4+
ms.date: 09/06/2023
5+
---
6+
# GetSystemVersion no longer returns ImageRuntimeVersion
7+
8+
<xref:System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion?displayProperty=nameWithType> no longer returns <xref:System.Reflection.Assembly.ImageRuntimeVersion?displayProperty=nameWithType>, which is a .NET Framework-oriented value. It's been updated to return a more relevant value, however, the historical leading `v` has been maintained.
9+
10+
## Previous behavior
11+
12+
<xref:System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion?displayProperty=nameWithType> returned <xref:System.Reflection.Assembly.ImageRuntimeVersion?displayProperty=nameWithType>, which is an indicator of .NET Framework in-place replacement, not a product release.
13+
14+
Example: `v4.0.30319`
15+
16+
## New behavior
17+
18+
Starting in .NET 8, <xref:System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion?displayProperty=nameWithType> returns `"v"` concatenated with <xref:System.Environment.Version?displayProperty=nameWithType>, which is the version of the CLR.
19+
20+
Example: `v8.0.0`
21+
22+
## Version introduced
23+
24+
.NET 8 RC 1
25+
26+
## Type of breaking change
27+
28+
This change is a [behavioral change](../../categories.md#behavioral-change).
29+
30+
## Reason for change
31+
32+
The existing version wasn't useful or meaningful for .NET.
33+
34+
## Recommended action
35+
36+
Update your code to expect the new version, or use `typeof(object).Assembly.ImageRuntimeVersion` instead.
37+
38+
## Affected APIs
39+
40+
- <xref:System.Runtime.InteropServices.RuntimeEnvironment.GetSystemVersion?displayProperty=fullName>
41+
42+
## See also
43+
44+
The following changes are related:
45+
46+
- [Improved .NET Core version APIs](../../../whats-new/dotnet-core-3-0.md#improved-net-core-version-apis)
47+
- [FrameworkDescription's value is .NET instead of .NET Core](../5.0/frameworkdescription-returns-net-not-net-core.md)
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: ".NET 8 breaking change: RuntimeIdentifier returns platform for which the runtime was built"
3+
description: Learn about the .NET 8 breaking change in core .NET libraries where RuntimeInformation.RuntimeIdentifier returns the platform for which the runtime was built.
4+
ms.date: 09/06/2023
5+
---
6+
# RuntimeIdentifier returns platform for which the runtime was built
7+
8+
<xref:System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier?displayProperty=nameWithType> returns the platform for which the runtime was built, rather than a value computed at run time.
9+
10+
## Previous behavior
11+
12+
The value was a runtime identifier (RID) computed via OS files or APIs. This generally meant it was a version-specific and distro-specific RID. For example, when running an application on Windows 11, the value was `win10-x64` or, on Ubuntu 20.04, it could be `ubuntu.20.04-x64`.
13+
14+
## New behavior
15+
16+
Starting in .NET 8, the value is the RID for which the runtime was built. This means that for portable builds of the runtime (all Microsoft-provided builds), the value is non-version-specific and non-distro-specific. For example, the value on Windows 11 is `win-x64`, and on Ubuntu 20.04, it's `linux-x64`. For non-portable builds (source-build), the build sets a build RID that can have a version and distro, and that value is the RID that's returned.
17+
18+
## Version introduced
19+
20+
.NET 8 RC 1
21+
22+
## Type of breaking change
23+
24+
This change is a [behavioral change](../../categories.md#behavioral-change).
25+
26+
## Reason for change
27+
28+
This change is in line with a .NET 8 change to [RID-specific asset resolution](../../deployment/8.0/rid-asset-list.md) and the move away from a distro-aware runtime. <xref:System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier?displayProperty=nameWithType> is an opaque value that should represent the platform on which the host or runtime considers itself to be running. In .NET 8, that corresponds to the platform for which the host or runtime is built, rather than an RID computed at run time.
29+
30+
## Recommended action
31+
32+
<xref:System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier?displayProperty=nameWithType> is an opaque value and not intended to be parsed into its component parts. For the OS version of the actual machine an application is running on, use <xref:System.Environment.OSVersion?displayProperty=nameWithType>. For a description, use <xref:System.Runtime.InteropServices.RuntimeInformation.OSDescription?displayProperty=nameWithType>. For a specific ID (distro) and corresponding version on Linux, you can read the [os-release](https://www.freedesktop.org/software/systemd/man/os-release.html) file.
33+
34+
## Affected APIs
35+
36+
- <xref:System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier?displayProperty=fullName>
37+
38+
## See also
39+
40+
- [.NET SDK uses a smaller RID graph](../../sdk/8.0/rid-graph.md)
41+
- [Host determines RID-specific assets](../../deployment/8.0/rid-asset-list.md)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ If you need to revert to the previous behavior of using the old, full RID graph,
3636
## See also
3737

3838
- [Host determines RID-specific assets](../../deployment/8.0/rid-asset-list.md)
39+
- [RuntimeIdentifier returns platform for which the runtime was built](../../core-libraries/8.0/runtimeidentifier.md)

docs/core/compatibility/toc.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ items:
5656
href: core-libraries/8.0/getgeneration-return-value.md
5757
- name: GetFolderPath behavior on Unix
5858
href: core-libraries/8.0/getfolderpath-unix.md
59+
- name: GetSystemVersion no longer returns ImageRuntimeVersion
60+
href: core-libraries/8.0/getsystemversion.md
5961
- name: IndexOfAnyValues renamed to SearchValues
6062
href: core-libraries/8.0/indexofanyvalues-renamed.md
6163
- name: ITypeDescriptorContext nullable annotations
@@ -66,6 +68,8 @@ items:
6668
href: core-libraries/8.0/parameterinfo-hasdefaultvalue.md
6769
- name: Removed overloads of ToFrozenDictionary/ToFrozenSet
6870
href: core-libraries/8.0/optimizeforreading-arg.md
71+
- name: RuntimeIdentifier returns platform for which runtime was built
72+
href: core-libraries/8.0/runtimeidentifier.md
6973
- name: Cryptography
7074
items:
7175
- name: AesGcm authentication tag size on macOS
@@ -1090,6 +1094,8 @@ items:
10901094
href: core-libraries/8.0/getgeneration-return-value.md
10911095
- name: GetFolderPath behavior on Unix
10921096
href: core-libraries/8.0/getfolderpath-unix.md
1097+
- name: GetSystemVersion no longer returns ImageRuntimeVersion
1098+
href: core-libraries/8.0/getsystemversion.md
10931099
- name: IndexOfAnyValues renamed to SearchValues
10941100
href: core-libraries/8.0/indexofanyvalues-renamed.md
10951101
- name: ITypeDescriptorContext nullable annotations
@@ -1100,6 +1106,8 @@ items:
11001106
href: core-libraries/8.0/parameterinfo-hasdefaultvalue.md
11011107
- name: Removed overloads of ToFrozenDictionary/ToFrozenSet
11021108
href: core-libraries/8.0/optimizeforreading-arg.md
1109+
- name: RuntimeIdentifier returns platform for which runtime was built
1110+
href: core-libraries/8.0/runtimeidentifier.md
11031111
- name: .NET 7
11041112
items:
11051113
- name: API obsoletions with default diagnostic ID

0 commit comments

Comments
 (0)