Skip to content

Instructions for using locally built NativeAOT builds are broken #119166

Open

Description

@jkotas

Repro steps

Follow instructions at https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/nativeaot.md#building-packages with current .NET 10 RC1

Result

C:\test>dotnet publish -c release --packages pkg
  Determining projects to restore...
  All projects are up-to-date for restore.
c:\net10-rc1\sdk\10.0.100-rc.1.25425.114\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.RuntimeIdentifierInference.target
s(345,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [C:\te
st\test.csproj]
  test -> C:\test\bin\release\net10.0\win-x64\test.dll
C:\test\pkg\microsoft.dotnet.ilcompiler\10.0.0-dev\build\Microsoft.DotNet.ILCompiler.SingleEntry.targets(60,5): warning
 : Delete explicit 'Microsoft.DotNet.ILCompiler' package reference in your project file to avoid versioning problems. [
C:\test\test.csproj]
C:\test\pkg\microsoft.dotnet.ilcompiler\10.0.0-dev\build\Microsoft.NETCore.Native.Publish.targets(70,5): error : The Pr
ivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative [C:\test\test.csproj]

C:\test>type nuget.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="local" value="C:\runtime\artifacts\packages\Release\Shipping" />
    <add key="dotnet10" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet10/nuget/v3/index.json" />
  </packageSources>
</configuration>

C:\test>type test.csproj
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
    <PublishAot>true</PublishAot>
    <InvariantGlobalization>true</InvariantGlobalization>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.DotNet.ILCompiler" Version="10.0.0-dev" />
  </ItemGroup>
</Project>

Activity

  1. added
    untriaged
    on Aug 28, 2025
  2. dotnet-policy-service commented on Aug 28, 2025

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
    See info in area-owners.md if you want to be subscribed.

  3. jkotas commented on Aug 28, 2025

    @jkotas
    MemberAuthor

    Regressed by #116882 . @jkoritzinsky Could you please take a look?

  4. jkotas commented on Sep 12, 2025

    @jkotas
    MemberAuthor

    @agocke is rewriting naot targets

  5. dellamonica commented on Sep 25, 2025

    @dellamonica

    I tried building with the mcr.microsoft.com/dotnet/nightly/sdk:10.0-preview-alpine-aot docker image and got NuGet errors that look similar to this.

    Unable to find package runtime.linux-musl-x64.Microsoft.DotNet.ILCompiler with version (= 10.0.0-rc.1.25425.114)
    

    Is there a workaround?

  6. agocke commented on Oct 7, 2025

    @agocke
    Member

    FYI, rewrite is too risky for .NET 10 so this will go into .NET 11.

  7. added this to the 11.0.0 milestone on Oct 7, 2025
  8. removed
    untriaged
    on Oct 7, 2025
  9. agocke commented on Nov 4, 2025

    @agocke
    Member

    Current workaround is:

      <ItemGroup>
        <PackageReference Include="Microsoft.DotNet.ILCompiler" Version="10.0.0-rtm.25507.103" />
        <KnownRuntimePack Update="@(KnownRuntimePack)">
          <LatestRuntimeFrameworkVersion Condition="'%(KnownRuntimePack.Identity)' == 'Microsoft.NETCore.App'
          and '%(KnownRuntimePack.RuntimePackLabels)' == 'NativeAOT'
          and '%(KnownRuntimePack.TargetFramework)' == 'net10.0'">10.0.0-rtm.25507.103</LatestRuntimeFrameworkVersion>
        </KnownRuntimePack>
        <KnownILCompilerPack Update="@(KnownILCompilerPack)">
          <ILCompilerPackVersion Condition="'%(KnownILCompilerPack.TargetFramework)' == 'net10.0'">10.0.0-rtm.25507.103</ILCompilerPackVersion>
        </KnownILCompilerPack>
      </ItemGroup>

    where the version number in the above is replaced with the desired version.

  10. Gabboxl commented on Feb 4, 2026

    @Gabboxl

    Hi, are there any updates on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

  • Status
    No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions