Skip to content

Pin NativeAOT ILCompiler to 10.0.10 to match the installed .NET 10 runtime#137

Merged
scottlerch merged 1 commit into
masterfrom
build/aot-ilcompiler-10.0.10
Jul 14, 2026
Merged

Pin NativeAOT ILCompiler to 10.0.10 to match the installed .NET 10 runtime#137
scottlerch merged 1 commit into
masterfrom
build/aot-ilcompiler-10.0.10

Conversation

@scottlerch

Copy link
Copy Markdown
Owner

Problem

Release builds (dotnet publish / build-all.ps1 -Sign) fail during NativeAOT compilation:

error : Overriding System.Private.CoreLib.dll with a newer version is not supported.
Attempted to use ...runtime.win-x64\10.0.10\...\System.Private.CoreLib.dll
instead of ...runtime.nativeaot.win-x64\10.0.9\...\System.Private.CoreLib.dll

The .NET SDK 10.0.302 (the latest available) still defaults the NativeAOT compiler to 10.0.9, but the self-contained runtime pack now resolves to the newer 10.0.10 servicing runtime. AOT requires the two to match, so every AOT project (Elevate, Cli, WinUI) fails to publish.

The .NET SDK and Windows App SDK are both already at their latest (10.0.302 / 2.2.0); this is purely the AOT compiler default lagging the runtime.

Fix

Pin Microsoft.DotNet.ILCompiler to 10.0.10 in the three AOT projects, aligning the compiler up to the runtime.

  • Only affects dotnet publish (release/AOT builds). CI runs dotnet build + dotnet test, which never invoke ILC, so the reference is inert in CI.
  • Verified: Elevate, Cli, and WinUI all publish clean (x64) after the change.
  • Bump alongside the runtime; remove once the SDK default catches up (noted in the csproj comments).

Needed to produce the signed v1.5.2 / v1.2.2 release artifacts.

🤖 Generated with Claude Code

…ntime

The .NET SDK 10.0.302 still defaults the NativeAOT compiler to 10.0.9, but the
self-contained runtime pack now resolves to 10.0.10 (a newer .NET 10 servicing
runtime). AOT publish then fails with "Overriding System.Private.CoreLib.dll with
a newer version is not supported" for every AOT project (Elevate, Cli, WinUI).

Align the compiler up to the runtime by pinning Microsoft.DotNet.ILCompiler to
10.0.10 in the three AOT projects. This only affects `dotnet publish` (release
builds); CI does `dotnet build`/`dotnet test`, which never invokes ILC, so the
reference is inert there. Bump alongside the runtime; remove once the SDK default
catches up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@scottlerch
scottlerch merged commit bb7bf21 into master Jul 14, 2026
2 checks passed
@scottlerch
scottlerch deleted the build/aot-ilcompiler-10.0.10 branch July 14, 2026 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant