Skip to content

Default RuntimeIdentifiers in .NET 8 #1876

@davidbritch

Description

@davidbritch

In .NET 8, the default RuntimeIdentifier(s) have changed:

  • iOS simulator: if the Mac's an ARM64 machine, then iossimulator-arm64. Otherwise (if it's an x86_64 Mac) then iossimulator-x64.
  • iOS device: no change (there's only one runtime identifier for device anyways, ios-arm64).
  • Desktop: if building for Debug, and the Mac's an ARM64 machine, then osx-arm64/maccatalyst-arm64. If building for Debug, and the Mac's an x86_64 machine, then osx-x64/maccatalyst-x64. If building for Release, the default stays the same as in .NET 7 (a universal build, osx-x64;osx-arm64 and maccatalyst-x64;maccatalyst-arm64).

The default can be overridden using the RuntimeIdentifer property (when targeting a single runtime identifier) or the RuntimeIdentifiers property (when creating a universal build consisting of multiple runtime identifiers):

<PropertyGroup>
    <RuntimeIdentifiers>osx-x64;osx-arm64</RuntimeIdentifiers>
</PropertyGroup>

Overriding the default might be necessary sometimes, in particular for projects that use third-party native bindings that don't contain an arm64 slice for the simulator.

There are two caveats:

  • When building remotely from the command line on Windows, the architecture detection will use the architecture of the Windows machine (because the RuntimeIdentifier has to be set early in the build process, before the build can connect to the Mac to figure out its architecture).
  • When building remotely using Visual Studio on Windows, the IDE will detect the architecture of the remote Mac and set it accordingly. Overriding the default can be done by setting the ForceSimulatorX64ArchitectureInIDE property:
<PropertyGroup>
    <ForceSimulatorX64ArchitectureInIDE>true</ForceSimulatorX64ArchitectureInIDE>
</PropertyGroup>

Associated WorkItem - 182906

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 10Work items for the .NET 10 release📌 seQUESTeredIdentifies that an issue has been imported into Quest.doc-enhancementImprove the current content [org]

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions