Repository navigation
Revert "Aggregate ASP.NET Core tool executables (#7020)" - #7124
Merged
Merged
Conversation
Member
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reverts the ASP.NET Core aggregated tool packaging introduced in #7020 (commit 7150f202...) to unblock Windows vertical builds that are failing due to an ILCompiler.SourceLinkWriter sharing-violation crash during NativeAOT compilation.
Changes:
- Removes the
aspnetcoretoolsNativeAOT aggregate tool project and reverts CLI/tool layout logic back to resolvingdotnet-dev-certs,dotnet-user-jwts, anddotnet-user-secretsas individual bundled tools. - Updates ASP.NET Core NativeAOT tool tests to publish/run each tool independently (instead of publishing the aggregate project).
- Cleans up related solution/build inputs by removing the aggregate project from sln filters / solution definitions.
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 | Removes unit coverage specific to aggregate tool package resolution. |
| src/sdk/src/Layout/redist/targets/GenerateBundledVersions.targets | Adjusts bundled CLI tools props generation for tool obsoletion references. |
| src/sdk/src/Layout/redist/targets/BundledDotnetTools.targets | Reverts bundled tool list to include individual ASP.NET Core tools instead of the aggregate package. |
| src/sdk/src/Cli/dotnet/CommandFactory/CommandResolution/DotnetToolsCommandResolver.cs | Removes aggregate-package fallback resolution logic from the CLI tool resolver. |
| src/aspnetcore/src/Tools/Tools.slnf | Removes the aggregate NativeAOT project from the Tools solution filter. |
| src/aspnetcore/src/Tools/Shared/TestHelpers/NativeAotToolRunner.cs | Updates test runner to locate published tools under per-tool subdirectories. |
| src/aspnetcore/src/Tools/NativeAot/test/Microsoft.AspNetCore.Tools.NativeAot.Tests.csproj | Publishes each NativeAOT tool under test individually into per-tool publish directories. |
| src/aspnetcore/src/Tools/NativeAot/aspnetcoretools/aspnetcoretools.csproj | Deletes the aggregate tool project. |
| src/aspnetcore/src/Tools/NativeAot/AspNetCoreTools.NativeAot.props | Removes aggregate-tool-specific NativeAOT defaults (moved to common targets). |
| src/aspnetcore/src/Tools/dotnet-user-secrets/src/dotnet-user-secrets.csproj | Removes aggregate-tool NativeAOT props import and simplifies RID settings for tool publishing. |
| src/aspnetcore/src/Tools/dotnet-user-jwts/src/dotnet-user-jwts.csproj | Removes aggregate-tool NativeAOT props import and simplifies RID settings for tool publishing. |
| src/aspnetcore/src/Tools/dotnet-dev-certs/src/dotnet-dev-certs.csproj | Removes aggregate-tool NativeAOT props import and simplifies RID settings for tool publishing. |
| src/aspnetcore/src/Tools/Directory.Build.targets | Centralizes NativeAOT publish property defaults previously in the removed props file. |
| src/aspnetcore/eng/Build.props | Removes the aggregate project from repo build inclusion/exclusion lists. |
| src/aspnetcore/AspNetCore.slnx | Removes the aggregate NativeAOT project from the solution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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]>
lewing
force-pushed
the
revert-aspnetcore-aggregate-tools
branch
from
June 8, 2026 15:55
93f83a4 to
ad98418
Compare
ViktorHofer
approved these changes
Jun 8, 2026
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.
This reverts commit 7150f20 (PR #7020).
Problem
The aspnetcoretools aggregation introduced by #7020 is causing ILC SourceLinkWriter crashes on Windows, breaking all main branch Windows vertical builds (both official and PR CI).
Error:
ILCompiler.SourceLinkWriter..ctoratSourceLinkWriter.cs:27(File.CreateText) throws a file-locked exception:Impact:
Root Cause Analysis
The crash has three contributing factors:
1. Multi-RID parallel ILC writes to same file
aspnetcoretools.csprojsetsRuntimeIdentifiers(potentially multiple RIDs) +NativeLib=Shared. MSBuild creates parallel build iterations per RID, and all ILC processes race on writingaspnetcoretools.sourcelinkviaFile.CreateText()— which on Windows uses exclusive file locking.2. Test project triggers overlapping publishes
Microsoft.AspNetCore.Tools.NativeAot.Tests.csprojhas aPublishNativeAotToolsForTeststarget that runsBeforeTargets="Build"and callsMSBuild Targets="Publish"onaspnetcoretools.csproj. This can overlap with the main build's publish of aspnetcoretools, creating concurrent ILC processes writing to the same intermediate files.3. Individual tools still have
PublishAot=trueThe three tool
.csprojfiles (dotnet-dev-certs,dotnet-user-jwts,dotnet-user-secrets) still declarePublishAot=trueindependently. This causes double ILC compilation — once via the aggregate project and once individually — creating additional file contention.Why Windows-only?
Linux/macOS don't enforce exclusive file locking on
File.CreateText, so concurrent writes succeed silently. Windows does enforce it, causingIOExceptionatSourceLinkWriter.cs:27.Timeline
Suggestions for re-landing
To re-land the aggregation fix, consider:
PublishAot=truefrom the individual tool projects since they're now aggregatedPublishNativeAotToolsForTeststarget to avoid overlapping with the main buildBuildInParallel="false"or otherwise serialize the ILC sourcelink writescc @DamianEdwards @dotnet/aspnet-build