RuntimeInformation.OSArchitecture under emulation

System.Runtime.InteropServices.RuntimeInformation.OSArchitecture now returns the correct value under emulation.

Previous behavior

Previously, RuntimeInformation.OSArchitecture returned Architecture.X64 in emulated processes on Windows Arm 64-bit and macOS Apple Silicon systems.

New behavior

Starting in .NET 7, RuntimeInformation.OSArchitecture returns Architecture.Arm64 in emulated processes on Windows Arm 64-bit and macOS Apple Silicon systems.

Version introduced

7 Preview 6

Type of breaking change

This change can affect binary compatibility.

Reason for change

The previous behavior was incorrect.

Code that expects the process architecture should be changed to call RuntimeInformation.ProcessArchitecture instead.

Affected APIs