dotnet / dotnet/sdk

Consider setting DOTNET_HOST_PATH only for SDKs that are resolved to be >= 10.0

Open
#49,735 0 comments 0 reactions 1 assignee Claimed by @baronfel View on GitHub
Area-SdkResolvers untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### Is your feature request related to a problem? Please describe.

The .NET 10 SDK Resolver gained the ability to provide environment variables that MSBuild will now set as part of evaluation/execution. This is used in .NET 10 to set key SDK-facing env vars like DOTNET_HOST_PATH. However, some environments for older SDKs may have previously calculated DOTNET_HOST_PATH to be the _directory_ containing the `dotnet` binary - not the correct semantic, which is the full path to the `dotnet` binary.

The SDK Container CreateNewImage ToolTask for net472 is one such example here, but there are likely others.

### Describe the solution you'd like

To mitigate this, we could consider only setting the env variables when the SDK resolved from the SdkResolver is 10+.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.