Repository navigation
Aggregate ASP.NET Core tool executables - #7020
Conversation
Co-authored-by: Copilot <[email protected]>
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]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
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]>
There was a problem hiding this comment.
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
aspnetcoretoolstool 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.
Co-authored-by: Copilot Autofix powered by AI <[email protected]>
baronfel
left a comment
There was a problem hiding this comment.
That turned out to be pretty clean 🤙
|
Are we waiting for more review here or is it ready to merge? |
|
@lewing was looking for a thumbs-up from @MichalStrehovsky but we can merge and do follow-up if necessary. |
Native AOT integration LGTM. |
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]>
Updates the tools bundled into the SDK from
dotnet/aspnetcoreto use the new preview "aggregate executable shims" feature to reduce the layout size on disk.A new
aspnetcoretools.csprojwas added to produce the aggregated executables and the SDK tool layout logic has been updated to resolvedotnet user-secrets,dotnet user-jwts, anddotnet dev-certsfrom 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