Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 7432cd8

Browse files
committed
Use same msbuild.exe for NuGet and solution build
NuGet was defaulting to the Visual Studio 2019 version of MSBuild (and failing). Force it to use the same msbuild.exe we locate for the solution build.
1 parent 865845e commit 7432cd8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

scripts/modules.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ New-Module -ScriptBlock {
115115
}
116116

117117
function Build-Solution([string]$solution, [string]$target, [string]$configuration, [switch]$ForVSInstaller, [bool]$Deploy = $false) {
118-
Run-Command -Fatal { & $nuget restore $solution -NonInteractive -Verbosity detailed }
118+
$msbuild = Find-MSBuild
119+
120+
Run-Command -Fatal { & $nuget restore $solution -NonInteractive -Verbosity detailed -MSBuildPath (Split-Path -parent $msbuild) }
119121
$flag1 = ""
120122
$flag2 = ""
121123
if ($ForVSInstaller) {
@@ -127,8 +129,6 @@ New-Module -ScriptBlock {
127129
$flag1 = "/p:Package=Skip"
128130
}
129131

130-
$msbuild = Find-MSBuild
131-
132132
Write-Host "$msbuild $solution /target:$target /property:Configuration=$configuration /p:DeployExtension=false /verbosity:minimal /p:VisualStudioVersion=15.0 /bl:output.binlog $flag1 $flag2"
133133
Run-Command -Fatal { & $msbuild $solution /target:$target /property:Configuration=$configuration /p:DeployExtension=false /verbosity:minimal /p:VisualStudioVersion=15.0 /bl:output.binlog $flag1 $flag2 }
134134
}

0 commit comments

Comments
 (0)