Problem
dotnet sets MSBuildExtensionsPath and MSBuildSDKsPath for its selected SDK. Descendant dotnet commands inherit those values even when they select a different SDK, which can mix SDK components and fail while loading tasks.
Failure: https://github.com/jaredpar/complog/actions/runs/31601500191/job/94129782284?pr=375
Repro/details: #14699
Expected
SDK-generated paths should be scoped to the immediate MSBuild invocation, not exposed as ambient state to unrelated child processes. Explicit user overrides must remain supported.
The top-level CLI should decide the effective values and map them to MSBuild through CLI-owned startup state/properties; nested dotnet commands should compute paths for their own selected SDK.
Design proposal
- At CLI entry, read any explicit user overrides.
- Otherwise compute paths from the SDK selected by that invocation.
- Pass the effective paths only to the immediate MSBuild instance through CLI-owned startup state or global properties, rather than setting generated defaults in the ambient environment.
- Propagate the values explicitly to MSBuild worker nodes.
This preserves intentional user overrides while allowing each nested dotnet invocation to use a coherent SDK.
Problem
dotnetsetsMSBuildExtensionsPathandMSBuildSDKsPathfor its selected SDK. Descendantdotnetcommands inherit those values even when they select a different SDK, which can mix SDK components and fail while loading tasks.Failure: https://github.com/jaredpar/complog/actions/runs/31601500191/job/94129782284?pr=375
Repro/details: #14699
Expected
SDK-generated paths should be scoped to the immediate MSBuild invocation, not exposed as ambient state to unrelated child processes. Explicit user overrides must remain supported.
The top-level CLI should decide the effective values and map them to MSBuild through CLI-owned startup state/properties; nested
dotnetcommands should compute paths for their own selected SDK.Design proposal
This preserves intentional user overrides while allowing each nested
dotnetinvocation to use a coherent SDK.