Skip to content

Aggregate ASP.NET Core tool executables - #7020

Merged
lewing merged 8 commits into
mainfrom
damianedwards/aggregate-aspnetcore-tools
Jun 7, 2026
Merged

lewing merged 8 commits into
mainfrom
damianedwards/aggregate-aspnetcore-tools

Conversation

@DamianEdwards

@DamianEdwards DamianEdwards commented Jun 4, 2026 •

Copy link
Copy Markdown
Member

Updates the tools bundled into the SDK from dotnet/aspnetcore to use the new preview "aggregate executable shims" feature to reduce the layout size on disk.

A new aspnetcoretools.csproj was added to produce the aggregated executables and the SDK tool layout logic has been updated to resolve dotnet user-secrets, dotnet user-jwts, and dotnet dev-certs from the aggregate tool shims folder.

Source build doesn't build the aggregated shims or native aot, preferring the pre-existing layout.

@baronfel @MichalStrehovsky @BrennanConroy

Closes dotnet/aspnetcore#66976

@dotnet-policy-service
dotnet-policy-service Bot requested review from a team June 4, 2026 00:41
DamianEdwards and others added 5 commits June 4, 2026 10:28
Exclude the aggregate NativeAOT tools project from source-only builds and scope product-build restore to the target RID so VMR vertical legs don't restore unavailable cross-RID runtime packs.

Co-authored-by: Copilot <[email protected]>
Exclude the aggregate ASP.NET Core tools project from the broad Tools test-subset glob so it is built only by its explicit non-source-only entry. This avoids parallel NativeAOT publishes racing on the same native output.

Co-authored-by: Copilot <[email protected]>
@DamianEdwards
DamianEdwards marked this pull request as ready for review June 5, 2026 14:48
Copilot AI review requested due to automatic review settings June 5, 2026 14:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates how ASP.NET Core CLI tools are bundled and resolved in the SDK by introducing a new aspnetcoretools aggregate tool package (NativeAOT aggregate executable shims) and updating the SDK’s tool resolution logic to find dotnet-dev-certs, dotnet-user-jwts, and dotnet-user-secrets within that aggregate layout (while keeping source-only builds on the existing per-tool layout).

Changes:

  • Add a new aspnetcoretools tool project that aggregates multiple ASP.NET Core tool executables into a single tool package.
  • Update SDK tool layout + resolution to locate the three ASP.NET Core tool commands under the aggregate tool folder when present.
  • Update ASP.NET Core NativeAOT tool test infrastructure to publish and discover tools from the new aggregate output layout.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/sdk/test/dotnet.Tests/CommandFactoryTests/GivenADotnetToolsCommandResolver.cs Adds a test covering tool resolution from the aggregate tool package layout.
src/sdk/src/Layout/redist/targets/GenerateBundledVersions.targets Updates bundled CLI tool reference generation to use the correct item name for obsoleted CLI tools.
src/sdk/src/Layout/redist/targets/BundledDotnetTools.targets Introduces aspnetcoretools as the bundled tool package (non-source-only) and gates legacy tool packages to source-only builds.
src/sdk/src/Cli/dotnet/CommandFactory/CommandResolution/DotnetToolsCommandResolver.cs Adds command-to-aggregate-package fallback mapping for tool resolution.
src/aspnetcore/src/Tools/Tools.slnf Includes the new aspnetcoretools project in the Tools solution filter.
src/aspnetcore/src/Tools/Shared/TestHelpers/NativeAotToolRunner.cs Updates test runner to locate published NativeAOT tools in the new aggregate publish directory layout.
src/aspnetcore/src/Tools/NativeAot/test/Microsoft.AspNetCore.Tools.NativeAot.Tests.csproj Publishes the aggregate tool project for tests instead of publishing each tool individually.
src/aspnetcore/src/Tools/NativeAot/aspnetcoretools/aspnetcoretools.csproj New aggregate tool project that references the individual tool projects via IncludeInAggregateExecutable.
src/aspnetcore/src/Tools/NativeAot/AspNetCoreTools.NativeAot.props New shared NativeAOT tuning properties factored out of Directory.Build.targets.
src/aspnetcore/src/Tools/dotnet-user-secrets/src/dotnet-user-secrets.csproj Imports shared NativeAOT props and adjusts RID configuration for DotNetBuild scenarios.
src/aspnetcore/src/Tools/dotnet-user-jwts/src/dotnet-user-jwts.csproj Imports shared NativeAOT props and adjusts RID configuration for DotNetBuild scenarios.
src/aspnetcore/src/Tools/dotnet-dev-certs/src/dotnet-dev-certs.csproj Imports shared NativeAOT props and adjusts RID configuration for DotNetBuild scenarios.
src/aspnetcore/src/Tools/Directory.Build.targets Removes inline NativeAOT tuning properties now provided via the new shared props file.
src/aspnetcore/eng/Build.props Ensures the new aggregate tool project is built when appropriate and excluded from broad include/exclude globs consistently.
src/aspnetcore/AspNetCore.slnx Adds the new aggregate tool project to the solution definition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@baronfel baronfel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That turned out to be pretty clean 🤙

@lewing

lewing commented Jun 6, 2026

Copy link
Copy Markdown
Member

Are we waiting for more review here or is it ready to merge?

@DamianEdwards

Copy link
Copy Markdown
Member Author

@lewing was looking for a thumbs-up from @MichalStrehovsky but we can merge and do follow-up if necessary.

@lewing
lewing merged commit 7150f20 into main Jun 7, 2026
11 checks passed
@lewing
lewing deleted the damianedwards/aggregate-aspnetcore-tools branch June 7, 2026 03:30
@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team June 7, 2026 03:30
@MichalStrehovsky

Copy link
Copy Markdown
Member

@lewing was looking for a thumbs-up from @MichalStrehovsky but we can merge and do follow-up if necessary.

Native AOT integration LGTM.

lewing added a commit that referenced this pull request Jun 8, 2026
This reverts commit 7150f20.

The aspnetcoretools aggregation is causing ILC SourceLinkWriter crashes
on Windows due to a file locking race in File.CreateText at
ILCompiler.SourceLinkWriter..ctor (SourceLinkWriter.cs:27). The
aspnetcoretools.sourcelink file is being accessed by multiple processes
simultaneously, causing all main branch Windows vertical builds to fail.

Co-authored-by: Copilot <[email protected]>
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.

Update SDK-bundled tools to use aggregate executable shims

6 participants