Add Visual Studio 2026 support in CI pipelines and CLI
Description
Type of Change
- Bug fix (non-breaking change which fixes an issue)
- Breaking change (fix or feature that would cause existing functionality to not work as expected)
- Automation (AI changes or Github Actions to reduce effort of manual tasks)
Why
Users with only VS2026 installed cannot run npx @react-native-community/cli run-windows because the CLI and CI pipelines are hardcoded for VS2022 (version 17.x). VS2026 uses version 18.x with platform toolset v145. The CLI was searching for VS with version range [17.11.0,18.0) which excludes VS2026.
Resolves #15387
What
-
CLI VS detection fix: Updated
vsInstalls.tsto extend the version range from[17.11.0,18.0)to[17.11.0,19.0)when minVersion is 17.x, allowing both VS2022 (17.x) and VS2026 (18.x) to be detected -
Updated
healthCheckList.ts: Display text now shows "Visual Studio 2022/2026" instead of just "Visual Studio 2022" -
New agent image config: Created
.ado/image/rnw-img-vs2026-node22.jsonwith VS bootstrapper URLhttps://aka.ms/vs/18/release/vs_Enterprise.exe(configuration template for infrastructure team to build and deploy) -
Updated all CI pipelines to use
rnw-img-vs2026-node22:-
windows-vs-pr.yml,windows-vs-pr-secure.yml,continuous.yml,compliance.yml,publish.yml
-
-
Updated
integrate-rn.yaml: Changed vmImage fromwindows-2022towindows-2025(latest available Azure DevOps hosted image -windows-2026does not exist) -
Updated
msbuild-sln.yml:-
msbuildVersion: 17.0→18.0 -
platformToolset: v143→v145
-
-
Updated
discover-google-test-adapter.yml: VS path updated to useMicrosoft Visual Studio\18\Enterprise(VS2026 installs to version-numbered folder18, not2026) -
Updated
vnext/Scripts/rnw-dependencies.ps1:- Changed ValidateSet tag from 'vs2022' to 'vs2026'
- Updated minimum VS version from
17.11.0to18.0.0 - Updated WinGet package references from
Microsoft.VisualStudio.2022.*toMicrosoft.VisualStudio.2026.* - Updated display name from "Visual Studio 2022" to "Visual Studio 2026"
-
Updated VS project files (following VS2019→VS2022 upgrade pattern from commit 5885ee4477e8a1d0fa992066abd1b405bef13b32):
-
AutomationChannel.sln- VisualStudioVersion from 17.x to 18.x -
AutomationChannel.vcxproj- MinimumVisualStudioVersion from 17.0 to 18.0 -
UsesPackageReference.csproj- MinimumVisualStudioVersion from 17.0 to 18.0 -
UsesPackagesConfig.vcxproj- MinimumVisualStudioVersion from 17.0 to 18.0
-
-
Added change files for versioning (
react-native-windows,@react-native-windows/cli,@react-native-windows/automation-channel, and@react-native-windows/telemetrypackages)
Note: The CI pipeline changes require the infrastructure team to build and deploy the rnw-img-vs2026-node22 image to the Azure DevOps agent pools before CI will work with VS2026. The CLI changes for local development with VS2026 are immediately functional.
This change follows the same pattern as the VS2019 to VS2022 upgrade in commit 5885ee4477e8a1d0fa992066abd1b405bef13b32.
Screenshots
N/A - CI configuration and CLI detection changes only.
Testing
The CLI fix allows users with VS2026 to successfully run npx @react-native-community/cli run-windows for local development. CI pipeline changes will be validated once the infrastructure team builds and deploys the rnw-img-vs2026-node22 agent image to the Azure DevOps pools.
Changelog
Should this change be included in the release notes: yes
Added Visual Studio 2026 support. The CLI now detects both VS2022 (17.x) and VS2026 (18.x). CI pipelines and project files updated to require VS2026 with platform toolset v145 (requires infrastructure team to deploy the new agent image).
Original prompt
This section details on the original issue you should resolve
<issue_title>Missing Visual Studio 2026 support</issue_title> <issue_description>### Problem Description
Having Visual Studio 2026 installed but not VS2022, the command
npx @react-native-community/cli run-windows --loggingwon't work, reporting missing MSBuild.I'm opening this as a bug, as VS2022 installation is inherently complicated/buggy, at least if you have VS2026 already.
Steps To Reproduce
In a fresh project created with
npx --yes @react-native-community/cli@latest init <projectName> --version "^0.80.0", and without VS2022, execute:> npx @react-native-community/cli run-windows --logging i Running x64 node on a x64 machine i Verbose: ON Looking for VS installs with version range: [17.11.0,18.0) Looking for vswhere at: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe ‼ No public VS release found i Trying pre-release VS Looking for VS installs with version range: [17.11.0,18.0] Looking for vswhere at: C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe × Could not find MSBuild with VCTools for Visual Studio 17.11.0 or later. Make sure all required components have been installed Command failed with error NoMSBuild: Could not find MSBuild with VCTools for Visual Studio 17.11.0 or later. Make sure all required components have been installedExpected Results
It should work, as it's the newest release of VS2026. Also, installing VS2022 is difficult if you have VS2026 installed.
Temporary solution
Manually changing the value
'17.11.0'with'18.0.0'in/node_modules/@react-native-windows/cli/lib-commonjs/utils/msbuildtools.jssolved the problem for me (for anybody interested). Obviously this isn't a solution, as proper support should be added, but a escape hatchCLI version
20.0.0
Environment
info Fetching system and libraries information... System: OS: Windows 11 10.0.26200 CPU: "(24) x64 AMD Ryzen 9 7900X 12-Core Processor " Memory: 28.26 GB / 63.14 GB Binaries: Node: version: 24.11.1 path: C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: version: 11.6.3 path: C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: Not Found Windows SDK: AllowDevelopmentWithoutDevLicense: Enabled Versions: - 10.0.22621.0 - 10.0.26100.0 IDEs: Android Studio: Not Found Visual Studio: - 18.0.11217.181 (Visual Studio Community 2026) Languages: Java: version: 22.0.2 path: C:\Program Files\OpenJDK\jdk-22.0.2\bin\javac.EXE Ruby: Not Found npmPackages: "@react-native-community/cli": installed: 20.0.0 wanted: 20.0.0 react: installed: 19.1.1 wanted: 19.1.1 react-native: installed: 0.80.1 wanted: 0.80.1 react-native-windows: installed: 0.80.0 wanted: ^0.80.0 npmGlobalPackages: "*react-native*": Not Found Android: hermesEnabled: true newArchEnabled: true iOS: hermesEnabled: Not found newArchEnabled: Not found info React Native v0.82.1 is now available (your project is running on v0.80.1). info Changelog: https://github.com/facebook/react-native/releases/tag/v0.82.1 info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.80.1&to=0.82.1 info For more info, check out "https://reactnative.dev/docs/upgrading?os=windows".Community Modules
No response
Target React Native Architecture
New Architecture (WinAppSDK) Only
Target Platform Version
None
Visual Studio Version
None
Build Configuration
None
Snack, code example, screenshot, or link to a repository
None</issue_description>
<agent_instructions>Update Visual Studio to 2026 in CI pipeline builds</agent_instructions>
Comments on the Issue (you are @copilot in this section)
- Fixes microsoft/react-native-windows#15399
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
Microsoft Reviewers: Open in CodeFlow
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
You alkso need to update to vs-2026 from vs-2022 in vnext/Scripts/rnw-dependencies.ps1
Updated in 47208e2. Changed VS version references from 2022 to 2026, including:
- ValidateSet tag: 'vs2022' → 'vs2026'
- Minimum version: 17.11.0 → 18.0.0
- WinGet packages: Microsoft.VisualStudio.2022.* → Microsoft.VisualStudio.2026.*
- Display name: "Visual Studio 2022" → "Visual Studio 2026"
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
Add chnage file
Added in e3788e6.
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
Getting error Failed to request agent. Exception Image rnw-img-vs2026-node22 doesn't exist in pool rnw-pool-8 in CI pipeline, fix it. SOmehow it is not finding the image rnw-img-vs2026-node22
Reverted in 936bf70. The rnw-img-vs2026-node22 image doesn't exist in the Azure DevOps agent pools yet - it needs to be built and deployed by the infrastructure team first. I've reverted all CI pipeline changes to use the existing rnw-img-vs2022-node22 images. The original issue about VS2026 support for local development (the CLI detecting VS2026) should be addressed separately by updating the msbuildtools.ts file to detect both VS2022 and VS2026.
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
Revert back to vs2026
Restored in ed042d7. All VS2026 CI pipeline changes are back in place.
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
update the msbuildtools.ts file to detect both VS2022 and VS2026.
Updated in 3807d86. Modified vsInstalls.ts to extend the version range from [17.11.0,18.0) to [17.11.0,19.0) when the minVersion is 17.x, allowing both VS2022 (17.x) and VS2026 (18.x) to be detected. Also updated healthCheckList.ts to show "Visual Studio 2022/2026".
[!WARNING]
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
googlechromelabs.github.io
- Triggering command:
/usr/local/bin/node /usr/local/bin/node install.mjs(dns block)https://storage.googleapis.com/chrome-for-testing-public/141.0.7390.122/linux64/chrome-headless-shell-linux64.zip
- Triggering command:
/usr/local/bin/node /usr/local/bin/node install.mjs(http block)If you need me to access, download, or install something from one of these locations, you can either:
- Configure Actions setup steps to set up my environment, which run before the firewall is enabled
- Add the appropriate URLs or hosts to the custom allowlist in this repository's Copilot coding agent settings (admins only)
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
ERROR: Change files are needed! Add chnage file
Added in c21e9d6. Created change file for the @react-native-windows/cli package.
/azp run
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.
/azp run
Azure Pipelines successfully started running 2 pipeline(s).
Getting the error in CI pipeline builds "##[error]Failed to request agent. Exception Image rnw-img-vs2026-node22 doesn't exist in pool rnw-pool-8 ,##[error]The remote provider was unable to process...
The image rnw-img-vs2026-node22 cannot be added to the agent pools through code changes. The .ado/image/rnw-img-vs2026-node22.json file I created is a configuration template that defines how the image should be built, but actually building and deploying the image to the Azure DevOps agent pools (rnw-pool-8, etc.) requires infrastructure team action:
- Use the image configuration to build the VM image with VS2026 installed
- Deploy the built image to the agent pools
This is an administrative task outside the scope of code changes. In the meantime, the CLI changes I made in vsInstalls.ts allow local development with VS2026 to work. For CI to work with VS2026, the infrastructure team needs to build and deploy the new agent image.
@protikbiswas100 , I bet in the past we had to update from VS 2019 to VS 2022. I wonder if you can discover that change and follow the same pattern. It is also maybe worth to ping @jonthysell about that change in the past.
@protikbiswas100 , I bet in the past we had to update from VS 2019 to VS 2022. I wonder if you can discover that change and follow the same pattern. It is also maybe worth to ping @jonthysell about that change in the past.
I followed and referenced this 3 years old commit from Jon and updated some of the files https://github.com/microsoft/react-native-windows/commit/5885ee4477e8a1d0fa992066abd1b405bef13b32#diff-c22885d97fa21ad974a3f5f982d92b6f45edc251fd34bc14223492ebd7391245
https://github.com/microsoft/react-native-windows/blob/main/.ado/image/rnw-img-vs2022-node22.json#L3
We need to update the VM image to 2025 and then we need to update codegen and versions here.
Instead of updating rnw-img-vs2022-node22.json I created a new image definition here called rnw-img-vs2026-node22.json, and what do you mean by updating codegen here?
/azp run
Azure Pipelines successfully started running 2 pipeline(s).