Skip to content

[Breaking change]: RuntimeEnvironment.GetSystemVersion no longer returns ImageRuntimeVersion  #36525

@richlander

Description

@richlander

Description

Context: dotnet/runtime#87908

.NET 7 behavior: dotnet/runtime#87908 (comment)

.NET 8 behavior: dotnet/runtime#87908 (comment)

In the past, this API returns a .NET Framework-oriented value. That isn't useful. It has been updated to return a more relevant value, however, the historical leading v has been maintained.

We tried to fix this class of issues in the past, but missed this one:

Related:

Version

.NET 8 RC 1

Previous behavior

Return ImageRuntimeVersion

New behavior

Return "v" + Environment.Version

Type of breaking change

  • Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
  • Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
  • Behavioral change: Existing binaries may behave differently at run time.

Reason for change

The existing version wasn't useful or meaningful.

Recommended action

Update code to expect new version or use typeof(object).Assembly.ImageRuntimeVersion instead.

Feature area

Core .NET libraries

Affected APIs

RuntimeEnvironment.GetSystemVersion


Associated WorkItem - 156742

Metadata

Metadata

Assignees

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.breaking-changeIndicates a .NET Core breaking change

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions