The version detection logic in tools.sh/ps1 will use a globally installed "dotnet" if the install directory contains the SDK version requested in global.json.
If there are multiple SDKs installed (one that happens to match the requested version), this can result in using a version later than the one requested. Together with #3763 this was resulting in local builds of coreclr using an incorrect SDK version in some cases.
The version detection logic in
tools.sh/ps1will use a globally installed "dotnet" if the install directory contains the SDK version requested in global.json.If there are multiple SDKs installed (one that happens to match the requested version), this can result in using a version later than the one requested. Together with #3763 this was resulting in local builds of coreclr using an incorrect SDK version in some cases.