Open safern opened 6 years ago
Fixed in source-build by setting env vars.
Reopening because I want to take a look at this: I feel like we should set that env var internally.
The env vars that I set in source-build to workaround this are:
DOTNET_MSBUILD_SDK_RESOLVER_SDKS_DIR = $DotNetCoreSdkDir
MSBuildSDKsPath = $DotNetCoreSdkDir\sdk\$env:SDK_VERSION\Sdks
SDK_VERSION
is set by source_build at the beginning of the execution. It is used across other repos.
Steps to reproduce
Revert PR: https://github.com/Microsoft/msbuild/pull/3340 Then go to dotnet/source-build repo. Checkout master branch and then update the src/msbuild git submodule to point to your branch that contains the reverted PR. To do this you need to push the branch to your fork and then in your source-build local repo from a command line go to src/msbuild and then run:
git remote add myfork https://github.com/<YourGHUser>/msbuild
git pull myfork <branchContainingChanges>
navigate back to source-build root and then run:
build.cmd /p:RootRepo=msbuild
If you look at the restored Microsoft.NETCore.App package for the Microsoft.Build.csproj it will restore the version of the dotnet SDK that you have installed in your machine rather than using the one that comes from the downloaded CLI in source-build.
Note that in source-build we're setting
DOTNET_MULTILEVEL_LOOKUP = 0
at the beginning of the execution to tell the cli to explicitly use the downloaded one.Also, if this is the first time using the source-build repo, before doing anything else, you need to run:
git submodule update --init --recursive
cc: @rainersigwald