-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Summary
Today the SdkResolver system can provide environment variables to the engine when an SDK is resolved. The primary usage of this feature is
- to keep invocations of the SDK unified across MSBuild-driven tooling via the
DOTNET_HOST_PATHenvironment variable - to drive usage of the .NET TaskHost feature for spawning .NET-targeted MSBuild tasks in a .NET TaskHost from a .NET Framework central node
However, the variables provided by this mechanism are currently overridden by ambient environment variables taken from the snapshot of the host process at the time the build is started. This means that external processes can override the SdkResolver's decisions.
Background and Motivation
Internal users are having some churn in mixed VS installs and need to set DOTNET_HOST_PATH in older VS environments to mitigate that churn, but want to defer to this feature in dev18 onwards by default.
Proposed Feature
We want the resolver to be the complete source of truth, so we should change the way the SdkResolver env vars are applied to the overall environmental state. The SdkResolver env vars should override any ambient env vars.
We need to make this change, update the existing tests, and add new tests pinning this behavior.
Alternative Designs
No response