Skip to content

Cannot nativeaot compile hello world #24447

@whisperecean

Description

@whisperecean

Apple platform

macOS

Framework version

net10.0-*

Affected platform version

net10.0-macos,xcode26.1.1

Description

Restore complete (0.2s) test_macos net10.0-macos osx-x64 failed with 4 error(s) (0.7s) → bin/Release/net10.0-macos/osx-x64/test_macos.dll ILLink : MacOSX error IL7000: An error occurred while executing the custom linker steps. Please review the build log for more information. ILLINK : error MM0099: No platform assembly! ILLINK : error MM2430: The linker step 'ManagedRegistrar' failed during processing: No platform assembly! /Users/dvu/.nuget/packages/microsoft.net.illink.tasks/10.0.1/build/Microsoft.NET.ILLink.targets(103,5): error NETSDK1144: Optimizing assemblies for size failed.


class MainClass {
    static void Main() {
        Console.WriteLine("Hello World!");
    }
}

with

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0-macos</TargetFramework>
    <ApplicationId>com.example.testmacos</ApplicationId>
		<PublishAot>true</PublishAot>
		<UseAppHost>true</UseAppHost>
  </PropertyGroup>

</Project>

workload installed:
macos 26.1.10502/10.0.100 SDK 10.0.100
xcode installed:
sudo xcode-select -s /Applications/Xcode-26.1.1.app/Contents/Developer
dotnet runtimes:
Microsoft.AspNetCore.App 10.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 10.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

What am I doing wrong?

Steps to Reproduce

  1. create a new hello world
  2. try to compile nativeaot with net10.0-macos

Did you find any workaround?

No response

Build logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue or pull request is an enhancement

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions