Skip to content

Require Visual Studio 2026 (v145) for native C++ projects - #2096

Draft
tyrielv wants to merge 4 commits into
microsoft:vnextfrom
tyrielv:tyrielv/vs2026-build-tools
Draft

Require Visual Studio 2026 (v145) for native C++ projects#2096
tyrielv wants to merge 4 commits into
microsoft:vnextfrom
tyrielv:tyrielv/vs2026-build-tools

Conversation

@tyrielv

@tyrielv tyrielv commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What

Retarget the native C++ projects from the v143 toolset (Visual Studio 2022)
to the v145 toolset that ships with Visual Studio 2026.

Why

The five native .vcxproj projects pinned PlatformToolset to v143. That
toolset ships only with Visual Studio 2022. On a machine or build agent that
carries Visual Studio 2026 but not 2022, a clean native build fails because
the v143 toolset is not present. The GitHub-hosted windows-2025 runner now
ships Visual Studio 2026 (v145), so the pinned v143 is also a CI risk.

Changes

  • Set PlatformToolset to v145 in the five native .vcxproj files.
  • Update .vsconfig to request the VC.v145.x86.x64 component.
  • Update .azure-pipelines/scripts/install-vs-cpp-workload.ps1 to require
    VS 2026 (18.0+) and download the VS 2026 Build Tools bootstrapper.
  • Update the Readme prerequisite and a stale Build.bat comment.

Validation

  • Local full Build.bat (Debug, x64) succeeds end to end: native C++ hooks
    compile and link with v145, managed NativeAOT publish, payload assembly,
    and the Inno Setup installer all produce output.
  • PR validation build (this PR) exercises the windows-2025 (x64) and
    windows-11-arm (arm64) runners, both of which ship VS 2026 with v145.

Notes

Targets vnext. This raises the build-tools floor to VS 2026, a behavior
change for the developer toolchain rather than a 2.0 regression fix, so it
soaks on vnext before promotion.

The native VFS projects pinned PlatformToolset v143, which ships only with
Visual Studio 2022. Build agents and developer machines that carry Visual
Studio 2026 do not have the v143 toolset, so a clean native build fails with
"the build tools for v143 cannot be found".

Retarget the native projects to the v145 toolset that ships with Visual
Studio 2026 (product line 18.x) and update the build provisioning to match:

- Set PlatformToolset to v145 in the five native .vcxproj files.
- Update .vsconfig to request the v145 build tools component.
- Update install-vs-cpp-workload.ps1 to require VS 2026 (18.0+) and to
  download the VS 2026 Build Tools bootstrapper.
- Update the Readme and a stale Build.bat comment.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
The default windows-11-arm runner image still ships Visual Studio 2022, which
lacks the v145 toolset the native projects now target. Use the preview
windows-11-vs2026-arm image so the arm64 build has VS 2026. Revert to
windows-11-arm once its default image migrates to VS 2026.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Build agents (and the windows-11-vs2026-arm runner) carry both VS 2022 and
VS 2026. Build.bat located MSBuild with a bare 'where msbuild.exe', which
returned the VS 2022 MSBuild; the native projects target the v145 toolset,
so that MSBuild failed with MSB8020 (v145 build tools not found).

Prefer 'vswhere -latest' (newest install, 18.x before 17.x) for both MSBuild
and vcvarsall, and fall back to PATH only when vswhere is unavailable. Pin the
setup-msbuild CI step to VS 2026 (18.0+) as well. Use the canonical
VC.Tools.x86.x64 component in .vsconfig so the latest (v145) toolset installs.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
The VS 2026 native arm64 compiler fails to build GVFS.NativeTests with C3859
(failed to create virtual memory for PCH) and C1076 (internal heap limit
reached) -- a known limitation where ARM64 native compiler support lags x64.

Initialize the VC++ environment with amd64_arm64 (x64-hosted arm64 cross
toolset, which Visual Studio uses by default for arm64) instead of the native
arm64 toolset. The cross compiler has the address space to build the PCH and
produces equivalent arm64 binaries. x64 builds are unchanged.

Assisted-by: Claude Opus 4.8
Signed-off-by: Tyrie Vella <tyrielv@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant