Skip to content

NativeAOT broken for Apple TFMs in .NET 10 #46790

Closed
@rolfbjarne

Description

@rolfbjarne

NativeAOT is broken for Apple TFMs after #46070.

Now the following fails:

dotnet build

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0-ios</TargetFramework>
    <PublishAot>true</PublishAot>
    <PublishAotUsingRuntimePack>true</PublishAotUsingRuntimePack>
  </PropertyGroup>
</Project>

with:

error NETSDK1225: Native compilation is not supported when invoking the Publish target directly. Try running dotnet publish.

and this fails:

dotnet build

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0-ios</TargetFramework>
    <PublishAot>true</PublishAot>
    <PublishAotUsingRuntimePack>false</PublishAotUsingRuntimePack>
  </PropertyGroup>
</Project>

with:

error NETSDK1203: Ahead-of-time compilation is not supported for the target runtime identifier 'iossimulator-arm64'.

In the past we've automatically set PublishAotUsingRuntimePack=true (always, not only for publish), which I believe we're still supposed to do.

CC @sbomer @MichalStrehovsky

Note: this effectively breaks NativeAOT support in .NET 10 Preview 1 for us.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-NativeAOTNative AOT compilationuntriagedRequest triage from a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions