Builders of large systems often want to be able to explicitly specify an SDK version and avoid installing the CLI to a machine-global location.
Currently, global.json allows the version lock, but the specified version must be installed in either a machine-global location or a nonstandard location must be specified by the environment variable DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR.
That environment means that you must launch Visual Studio from a specific environment to get the downloaded/private SDKs.
There could be an extension to the SDK resolver to respect a path specified in the global.json. Something like
{
"sdk": {
"version": "1.0.0",
"path": "tools/downloadedsdk"
}
}
could be equivalent to setting DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR=%GlobalJsonPath%\tools\downloadedsdk before invoking the resolver.
This would be visible by any invocation (dotnet, msbuild, VS, or MSBuild API) since it's file-based.
Builders of large systems often want to be able to explicitly specify an SDK version and avoid installing the CLI to a machine-global location.
Currently,
global.jsonallows the version lock, but the specified version must be installed in either a machine-global location or a nonstandard location must be specified by the environment variableDOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR.That environment means that you must launch Visual Studio from a specific environment to get the downloaded/private SDKs.
There could be an extension to the SDK resolver to respect a path specified in the
global.json. Something like{ "sdk": { "version": "1.0.0", "path": "tools/downloadedsdk" } }could be equivalent to setting
DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR=%GlobalJsonPath%\tools\downloadedsdkbefore invoking the resolver.This would be visible by any invocation (
dotnet,msbuild, VS, or MSBuild API) since it's file-based.