@@ -211,12 +211,12 @@ function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $arc
211
211
InstallDotNet - dotnetRoot $dotnetRoot - version $version - architecture $architecture - skipNonVersionedFiles $false - runtimeSourceFeed $runtimeSourceFeed - runtimeSourceFeedKey $runtimeSourceFeedKey
212
212
}
213
213
214
- function InstallDotNet ([string ] $dotnetRoot ,
215
- [string ] $version ,
216
- [string ] $architecture = " " ,
217
- [string ] $runtime = " " ,
218
- [bool ] $skipNonVersionedFiles = $false ,
219
- [string ] $runtimeSourceFeed = " " ,
214
+ function InstallDotNet ([string ] $dotnetRoot ,
215
+ [string ] $version ,
216
+ [string ] $architecture = " " ,
217
+ [string ] $runtime = " " ,
218
+ [bool ] $skipNonVersionedFiles = $false ,
219
+ [string ] $runtimeSourceFeed = " " ,
220
220
[string ] $runtimeSourceFeedKey = " " ) {
221
221
222
222
$installScript = GetDotNetInstallScript $dotnetRoot
@@ -323,7 +323,16 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
323
323
}
324
324
325
325
$msbuildVersionDir = if ([int ]$vsMajorVersion -lt 16 ) { " $vsMajorVersion .0" } else { " Current" }
326
- return $global :_MSBuildExe = Join-Path $vsInstallDir " MSBuild\$msbuildVersionDir \Bin\msbuild.exe"
326
+
327
+ $local :BinFolder = Join-Path $vsInstallDir " MSBuild\$msbuildVersionDir \Bin"
328
+ $local :Prefer64bit = if (Get-Member - InputObject $vsRequirements - Name ' Prefer64bit' ) { $vsRequirements.Prefer64bit } else { $false }
329
+ if ($local :Prefer64bit -and (Test-Path (Join-Path $local :BinFolder " amd64" ))) {
330
+ $global :_MSBuildExe = Join-Path $local :BinFolder " amd64\msbuild.exe"
331
+ } else {
332
+ $global :_MSBuildExe = Join-Path $local :BinFolder " msbuild.exe"
333
+ }
334
+
335
+ return $global :_MSBuildExe
327
336
}
328
337
329
338
function InitializeVisualStudioEnvironmentVariables ([string ] $vsInstallDir , [string ] $vsMajorVersion ) {
@@ -523,7 +532,7 @@ function InitializeNativeTools() {
523
532
}
524
533
}
525
534
526
- function InitializeToolset ([string ] $runtimeSourceFeed , [string ] $runtimeSourceFeedKey )
535
+ function InitializeToolset ([string ] $runtimeSourceFeed , [string ] $runtimeSourceFeedKey )
527
536
{
528
537
if (Test-Path variable:global:_ToolsetBuildProj) {
529
538
return $global :_ToolsetBuildProj
0 commit comments