Skip to content

Commit 85280fb

Browse files
committed
!temporary! Try using 64bit msbuild
- will be mostly overwritten in next 3.1 Arcade update
1 parent dcf49a0 commit 85280fb

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

eng/common/tools.ps1

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,12 @@ function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $arc
211211
InstallDotNet -dotnetRoot $dotnetRoot -version $version -architecture $architecture -skipNonVersionedFiles $false -runtimeSourceFeed $runtimeSourceFeed -runtimeSourceFeedKey $runtimeSourceFeedKey
212212
}
213213

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 = "",
220220
[string] $runtimeSourceFeedKey = "") {
221221

222222
$installScript = GetDotNetInstallScript $dotnetRoot
@@ -323,7 +323,16 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
323323
}
324324

325325
$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 ($vsRequirements.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
327336
}
328337

329338
function InitializeVisualStudioEnvironmentVariables([string] $vsInstallDir, [string] $vsMajorVersion) {
@@ -523,7 +532,7 @@ function InitializeNativeTools() {
523532
}
524533
}
525534

526-
function InitializeToolset([string] $runtimeSourceFeed, [string] $runtimeSourceFeedKey)
535+
function InitializeToolset([string] $runtimeSourceFeed, [string] $runtimeSourceFeedKey)
527536
{
528537
if (Test-Path variable:global:_ToolsetBuildProj) {
529538
return $global:_ToolsetBuildProj

global.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"Microsoft.VisualStudio.Component.VC.ATL",
2121
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
2222
"Microsoft.VisualStudio.Component.Windows10SDK.17134"
23-
]
23+
],
24+
"Prefer64bit": true
2425
}
2526
},
2627
"msbuild-sdks": {

0 commit comments

Comments
 (0)