Repository navigation
Target .NET 11 for NAOT-published generators - #2657
Draft
Sergio Pedri (Sergio0694) wants to merge 1 commit into
Draft
Sergio Pedri (Sergio0694) wants to merge 1 commit into
Sergio Pedri (Sergio0694) wants to merge 1 commit into
Conversation
Move the five Native AOT CLI build tools to net11.0 via a new ToolDotNetVersion property, leaving all other projects on net10.0. Update build.cmd and the CI pipelines to use the .NET 11 SDK and the new tool output paths. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sergio Pedri (Sergio0694)
requested a review
from Manodasan Wignarajah (manodasanW)
November 12, 2026 22:01
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Move the five Native AOT-published CLI build tools (the
WinRT.*.Generatorprojects) to target .NET 11, and update the build script and CI to use the .NET 11 SDK. All other projects stay on .NET 10, andLangVersionstays at14.0(the C# 15 update will come in a separate PR).Motivation
.NET 11 is now released, and the NAOT-published tools never load the projects they process into the runtime, so they can safely target a newer .NET version than the rest of the repo. In local benchmarks against real debug repros, the .NET 11 builds were slightly faster on wall time (about 3% for the interop generator, and 2-4% for the Windows SDK and merged projection generators), with similar memory use.
Changes
src/Directory.Build.props: add aToolDotNetVersionproperty (net11.0) next toDotNetVersion, and use it for the*EffectiveToolsDirectoryoutput paths.src/WinRT.{Interop,Impl,Projection,Projection.Ref,WinMD}.Generator/*.csproj: target$(ToolDotNetVersion)instead of$(DotNetVersion).src/WinRT.Internal/WinRT.Internal.csprojandsrc/Tests/*GeneratorTest/*.csproj: use$(ToolDotNetVersion)for the tool output paths, and addSkipGetTargetFrameworkProperties="true"to the toolProjectReferenceitems (a net10 project can't otherwise reference a net11 one), with comments updated and reflowed.src/WinRT.Interop.Generator/Extensions/*.csandsrc/WinRT.WinMD.Generator/Extensions/ModuleDefinitionExtensions.cs: replaceFrozenDictionary<...>.Emptywith[]to satisfy IDE0301, which the .NET 11 SDK flags and which fails Release builds.src/build.cmd,build/AzurePipelineTemplates/*.ymland.github/workflows/product.yml: bump the build SDK from10.0.402to11.0.100, and point the tool publish paths atnet11.0..github/copilot-instructions.md: document the new tool target framework.