Skip to content

RuntimeInformation.OSArchitecture returns X64 unexpectedly on arm64-Windows system #130398

Description

@JensNordenbro

Description

On Windows ARM (Surface Pro X) RuntimeInformation.OSArchitecture differs between net481 and net10.0 when RID win-x86 is forced.

Reproduction Steps

  1. Add this code to Program.cs on a Console app:
Architecture osArchitecture = RuntimeInformation.OSArchitecture;
Console.WriteLine($"OS Architecture: {osArchitecture}");
  1. compilie using dotnet publish -f net481 -r win-x86 ...

  2. Run executable

Expected behavior

"OS Architecture: Arm64" as console output, just like when publishing for framework net10.0 with the same rid.

Actual behavior

"OS Architecture: X64" as console output.

Regression?

Yes, we haad this working before but hard to reproduce.

Known Workarounds

No response

Configuration

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions