Skip to content

Commit c55ef23

Browse files
Prefer VS 2022 specifically, not 2017/2019/2022 as a group
The .vcxproj files pin PlatformToolset v143, which ships with VS 2022. VS 2017 (v141) and VS 2019 (v142) would need v143 build tools sideloaded to build this, which is a non-default setup — so they shouldn't be treated as equals to VS 2022 in the preference order.
1 parent fc9a784 commit c55ef23

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

contrib/win32/openssh/OpenSSHBuildHelper.psm1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,11 @@ function Get-VisualStudioPath {
619619
$VSPaths = (& $vsWherePath -products * -requires $requiredVCtools -property installationPath)
620620
# for some reason, VSWhere does not seem to find MSBuild so check manually
621621
if ($null -ne $VSPaths) {
622-
# Prefer supported versions (2022/2019/2017) over newer unsupported ones (e.g., 2026)
623-
$preferred = @($VSPaths | Where-Object { $_ -match '\\(2022|2019|2017)\\' })
624-
$ordered = $preferred + @($VSPaths | Where-Object { $_ -notmatch '\\(2022|2019|2017)\\' })
622+
# Prefer VS 2022 — the .vcxproj files pin <PlatformToolset>v143</PlatformToolset>,
623+
# which ships with VS 2022. Older VS (2017=v141, 2019=v142) would need v143 build tools
624+
# sideloaded; newer VS (e.g. 2026) defaults to v145 which isn't supported here.
625+
$preferred = @($VSPaths | Where-Object { $_ -match '\\2022\\' })
626+
$ordered = $preferred + @($VSPaths | Where-Object { $_ -notmatch '\\2022\\' })
625627
foreach ($VSPath in $ordered) {
626628
if (Get-MSBuildPath -VSInstallPath $VSPath) {
627629
return $VSPath

0 commit comments

Comments
 (0)