Repository navigation
Description
Summary
All main branch VMR official builds (dnceng/internal, pipeline 1330) have been failing since June 5 with MSB4216 when the GenerateSdkRuntimeIdentifierChain task attempts to launch via TaskHostFactory. The failure is on every platform (Linux x64/arm64/arm, Windows x64/x86/arm64, macOS arm64).
Error
src/sdk/src/Layout/redist/targets/GenerateLayout.targets(26,5): error MSB4216:
Could not run the "GenerateSdkRuntimeIdentifierChain" task because MSBuild could not
create or connect to a task host with runtime "NET" and architecture "x64".
Please ensure that (1) the requested runtime and/or architecture are available on the
machine, and (2) that the required executable
"/__w/1/s/.dotnet/sdk/11.0.100-preview.5.26227.104/MSBuild" exists and can be run.
Bisection
- Last passing build: 2992950 (commit
025cac314d7, June 5 ~11:00 UTC) - First failing build: 2993147 (commit
d233c67796b, June 5 ~16:00 UTC)
The introducing commit range includes SDK code flow dotnet/dotnet#7064 (44865609a40) as the prime suspect.
Key findings
1. redist.csproj was not previously built in VMR
In the passing build (2992950), searching the Linux_x64 log (59,294 lines) for GenerateSdkRuntimeIdentifierChain, RuntimeIdentifierChain, TaskHostFactory, or redist -> returns zero matches. The redist.csproj build target was not being reached.
In the failing build, the log shows:
redist -> /__w/1/s/src/sdk/artifacts/bin/redist/Release/net11.0/redist.dll
error MSB4216: ...
Something in SDK code flow #7064 changed the build graph so that redist.csproj is now actively built in the VMR where it wasn't before.
2. dotnetup runs in VMR despite from_vmr guard
configure-toolset.sh was updated to call InstallBootstrapSdkWithDotnetup at the top level. It has a guard:
if [[ "$restore" != true || "$from_vmr" == true || -z "$dotnet_sdk_version" ]]; then
return
fiHowever, the VMR build log shows dotnetup is running:
Installing SDK(s) '11.0.100-preview.5.26227.104' to '/__w/1/s/src/sdk/.dotnet' via dotnetup...
Downloading https://aka.ms/dotnet/dotnetup/daily/dotnetup-linux-x64
dotnetup installed successfully to /__w/1/s/src/sdk/eng/dotnetup
The VMR does pass --fromVMR (repo-projects/Directory.Build.props:128), and build.sh parses it before sourcing configure-toolset.sh, so from_vmr should be true. Unclear why the guard isn't catching it.
3. Task host handshake or launch failure
The GenerateSdkRuntimeIdentifierChain task is declared with TaskFactory="TaskHostFactory" Runtime="NET" in sdk-tasks.InTree.targets. This forces MSBuild to spawn an out-of-process task host using the MSBuild apphost at {sdkPath}/MSBuild.
The code path in NodeProviderOutOfProcTaskHost.ResolveAppHostOrFallback():
MSBuildapphost exists at.dotnet/sdk/11.0.100-preview.5.26227.104/MSBuild→useAppHost=trueDOTNET_HOST_PATHis set (/__w/1/s/.dotnet/dotnet) →DOTNET_ROOTshould be derived correctly- The apphost is launched but the parent/child handshake fails → MSB4216
This may be related to dotnet/msbuild#13879 (task host handshake architecture mismatch).
Impact
- All
mainbranch builds are broken — 0% clean pass rate since June 5 - Code flow PRs to
main(aspnetcore, runtime, roslyn, efcore) are blocked from validation - No new BAR assets are being published from
main
Affected builds
| Build | Date | Commit |
|---|---|---|
| 2994109 | June 7 | 7150f20 |
| 2993907 | June 6 | 01a993d |
| 2993793 | June 6 | af0627d |
| 2993688 | June 6 | af0627d |
| 2993396 | June 5 | ba0c241 |
| 2993249 | June 5 | 3ab08f7 |
| 2993147 | June 5 | d233c67 |
Suggested investigation
- Why is
redist.csprojnow being built in the VMR when it wasn't before? Check if the SDK code flow changed the traversal/graph build entry points. - Why is
InstallBootstrapSdkWithDotnetupexecuting despite thefrom_vmrguard? - Consider whether
GenerateSdkRuntimeIdentifierChainneedsTaskHostFactoryat all, or if it can run in-process.
/cc @dotnet/dotnet-cli
Activity
lewing commentedon Jun 7, 2026
see also #7105 which is being caused by dotnetup installed sdk
ViktorHofer commentedon Jun 8, 2026
Root cause for finding (2): dotnetup runs via the Setup Internal Feeds step, not the main build
I traced where the
Installing SDK(s) '…' to '…/src/sdk/.dotnet' via dotnetup…line actually comes from, using theLinux_x64_BuildLogsartifact + raw console log of the first failing build (2993147).Key timing observation
In the Linux_x64 job:
src/sdk/.dotnetBuilding sdkbanner runs, and this one does pass--fromVMR(so itssrc/sdk/sdk.logcontains no dotnetup line — the guard works there)So the dotnetup install happens ~80 min earlier, in a different step. The console shows it directly under
Setting up internal NuGet feeds for sdk, i.e. the "Setup Internal Feeds" task.The invocation chain
eng/pipelines/templates/jobs/vmr-build.yml(Setup Internal Feeds, ~L568) loops over everysrc/<repo>and runseng/common/SetupNugetSources.ps1.SetupNugetSources.ps1:35→. $PSScriptRoot\tools.ps1(dot-sources tools.ps1).tools.ps1dot-sourcesconfigure-toolset.ps1, whose top level callsInstallBootstrapSdkWithDotnetup.tools.ps1defaults:tools.ps1:20→$restoredefaults to$truetools.ps1:66→$fromVMRdefaults to$false(-not $true) -or $false -or [empty]= false → it does not return → dotnetup runs, droppingsrc/sdk/eng/dotnetup/dotnetup+src/sdk/artifacts/.dotnetup/...and a populatedsrc/sdk/.dotnetinto the tree (these show up inbinary-report/NewBinaries.txt).Conclusion
The
from_vmrcondition logic itself is correct — but it's bypassed by the entry path.configure-toolsetrunsInstallBootstrapSdkWithDotnetupunconditionally whenevertools.ps1is merely sourced.SetupNugetSources.ps1sourcestools.ps1purely to set up feeds, in a context with no-fromVMRand a default$restore=$true, so the guard seesfromVMR=false, restore=trueand fires. (This would trigger anywhereSetupNugetSources.ps1runs — it's not VMR-build-specific.)Suggested fix: gate
InstallBootstrapSdkWithDotnetupso it only runs from an actualbuild.ps1/build.shrestore, not from a baretools.ps1dot-source (e.g. viaSetupNugetSources.ps1). Thefrom_vmr/restoredefaults make the current top-level call fire in non-build contexts.ViktorHofer commentedon Jun 8, 2026
Took me ~45min to find this but that's the actual regression
ViktorHofer commentedon Jun 8, 2026
Fix proposed in dotnet/arcade#16984 — SetupNugetSources now sets disableConfigureToolsetImport before sourcing
tools, so the "Setup Internal Feeds" step no longer triggers the SDK's InstallBootstrapSdkWithDotnetup (dotnetup) as a side effect. Once it flows to the VMR, the bootstrap SDK will stop being dropped into src/sdk/.dotnet.ViktorHofer commentedon Jun 9, 2026
The fix unfortunately didn't work. Reopening.
ViktorHofer commentedon Jun 9, 2026
OK I missed bringing this to the VMR root as well: #7145