Repository navigation
Restore aggregate ASP.NET Core tool executables - #7131
Conversation
Re-land the aggregate ASP.NET Core tool executable layout from #7020 and isolate the NativeAOT test publish intermediates so Windows product and test publishes do not race on aspnetcoretools.sourcelink. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR re-lands the “aggregate ASP.NET Core tool executables” layout so the SDK can resolve dotnet dev-certs, dotnet user-jwts, and dotnet user-secrets from a single aggregated tool package (aspnetcoretools), while avoiding the Windows NativeAOT SourceLink intermediate file-lock race by isolating test-triggered publish intermediates.
Changes:
- Update SDK tool layout + resolution to use the
aspnetcoretoolsaggregate package for the ASP.NET Core bundled tools (non-source-only builds). - Add/enable the new
aspnetcoretools.csprojaggregate tool project and wire it into ASP.NET Core solution/build inputs. - Prevent test-triggered NativeAOT publishes from racing with product publishes by using a dedicated
NativeIntermediateOutputPathfor tests and updating test helper expectations to the new publish layout.
Reviewed changes
Copilot reviewed 14 out of 14 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 ensuring aggregated tool package layout resolves executables correctly. |
| src/sdk/src/Layout/redist/targets/BundledDotnetTools.targets | Switches bundled tool restore/layout to aspnetcoretools for non-source-only builds; keeps individual tool packages for source-only. |
| src/sdk/src/Cli/dotnet/CommandFactory/CommandResolution/DotnetToolsCommandResolver.cs | Adds fallback mapping so dotnet-dev-certs, dotnet-user-jwts, and dotnet-user-secrets resolve from aspnetcoretools when their direct folders aren’t present. |
| src/aspnetcore/src/Tools/Tools.slnf | Includes the new aggregate tool project in the tools solution filter. |
| src/aspnetcore/src/Tools/Shared/TestHelpers/NativeAotToolRunner.cs | Updates test helper to locate published executables under the aggregated nativeaot-tools layout. |
| src/aspnetcore/src/Tools/NativeAot/test/Microsoft.AspNetCore.Tools.NativeAot.Tests.csproj | Publishes aggregate tools for tests with an isolated NativeAOT intermediate path to prevent Windows file-lock races. |
| src/aspnetcore/src/Tools/NativeAot/aspnetcoretools/aspnetcoretools.csproj | Adds the aggregate tool project that produces the combined tool executables. |
| src/aspnetcore/src/Tools/NativeAot/AspNetCoreTools.NativeAot.props | Centralizes NativeAOT publish settings used by the aggregate and individual tool projects. |
| src/aspnetcore/src/Tools/dotnet-user-secrets/src/dotnet-user-secrets.csproj | Aligns RID settings for product builds and imports shared NativeAOT publish settings. |
| src/aspnetcore/src/Tools/dotnet-user-jwts/src/dotnet-user-jwts.csproj | Aligns RID settings for product builds and imports shared NativeAOT publish settings. |
| src/aspnetcore/src/Tools/dotnet-dev-certs/src/dotnet-dev-certs.csproj | Aligns RID settings for product builds and imports shared NativeAOT publish settings. |
| src/aspnetcore/src/Tools/Directory.Build.targets | Removes NativeAOT publish property defaults (moved into the new shared props file). |
| src/aspnetcore/eng/Build.props | Ensures the aggregate tool project is included/excluded appropriately in build project lists/subsets. |
| src/aspnetcore/AspNetCore.slnx | Adds the new aggregate tool project to the solution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address review feedback by using the SDK test infrastructure to create the temporary DotnetTools layout instead of manually deleting an ad-hoc temp path. Co-authored-by: Copilot <[email protected]>
Address review feedback by guarding temp directory cleanup and ignoring cleanup failures without requiring SdkTest redist setup. Co-authored-by: Copilot <[email protected]>
Build the aggregate ASP.NET Core tool publish output as part of the aggregate project build, then make the NativeAOT tests consume that product output through a sequencing ProjectReference instead of running a second publish. Co-authored-by: Copilot <[email protected]>
Set _IsPublishing statically so Build and Publish share the same project instance, and default RuntimeIdentifier when NativeAOT publish is enabled. This avoids re-entering aspnetcoretools with global properties while keeping the test project's publish dependency deterministic. Co-authored-by: Copilot <[email protected]>
|
@lewing ready for your review |
Depend on the SDK core publish targets from the build hook instead of the Publish target itself. This keeps the publish work in the same project instance while avoiding the Publish -> Build -> after-Build -> Publish cycle. Co-authored-by: Copilot <[email protected]>
lewing
left a comment
There was a problem hiding this comment.
Looks good me, you could do an official build if you wanted to be 100% sure
|
/azp run dotnet-unified-build-full |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@DamianEdwards FYI I've added guidance to cover how to handle this to dotnet/skills: dotnet/skills#770 |
Co-authored-by: Copilot <[email protected]>
|
@wtgodbe can I get another approval after the merge to fix the conflict pls? |
Re-lands the aggregate ASP.NET Core tool executable changes from #7020 after the revert in #7124.
#7124 identified Windows ILC
SourceLinkWriterfile-lock failures caused by overlapping NativeAOT publishes writing the sameaspnetcoretools.sourcelinkintermediate. This re-land keeps the aggregate executable layout, but gives the test-triggered aggregate publish its ownNativeIntermediateOutputPathso it cannot race with the product publish on the same SourceLink/intermediate files.Validation performed locally on Windows:
src\aspnetcore\src\Tools\NativeAot\aspnetcoretools\aspnetcoretools.csprojforwin-x64.PublishNativeAotToolsForTestsonsrc\aspnetcore\src\Tools\NativeAot\test\Microsoft.AspNetCore.Tools.NativeAot.Tests.csprojforwin-x64.aspnetcoretools.sourcelinkpaths under separateartifacts\objdirectories.Note: the full documented ASP.NET Core
eng\build.cmdpath is currently blocked before reaching these projects by an unrelated GenerateFiles task/package mismatch where the resolvedMicrosoft.DotNet.Build.Tasks.Templatingtask does not expose theSkipUnchangedparameter used by source.