diff --git a/eng/build.ps1 b/eng/build.ps1 index 4ad71aebd0f06d8757ce1a6cba7c4f2ecd9b0a51..cd9e9e1e75b88586d4a6873e1d3f35a4c40067a9 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -215,8 +215,8 @@ function BuildSolution() { $quietRestore = !($ci -or ($bootstrapDir -ne "")) $testTargetFrameworks = "" + $testTargetFrameworks = "netcoreapp2.1" if ($testCoreClr) { - $testTargetFrameworks = "netcoreapp2.1" # Make sure a 2.1 runtime is installed so we can run our tests. Most of them still # target netcoreapp2.1. @@ -575,6 +575,15 @@ try { } } + if ($ci) { + $global:_DotNetInstallDir = Join-Path $RepoRoot ".dotnet" + InstallDotNetSdk $global:_DotNetInstallDir $GlobalJson.tools.dotnet + + # Make sure a 2.1 runtime is installed so we can run our tests. Most of them still + # target netcoreapp2.1. + InstallDotNetSdk $global:_DotNetInstallDir "2.1.401" + } + if ($bootstrap) { $bootstrapDir = Make-BootstrapBuild }