Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 27, 2025

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.ts to 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.json with VS bootstrapper URL https://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 from windows-2022 to windows-2025 (latest available Azure DevOps hosted image - windows-2026 does not exist)
  • Updated msbuild-sln.yml:
    • msbuildVersion: 17.018.0
    • platformToolset: v143v145
  • Updated discover-google-test-adapter.yml: VS path updated to use Microsoft Visual Studio\18\Enterprise (VS2026 installs to version-numbered folder 18, not 2026)
  • Updated vnext/Scripts/rnw-dependencies.ps1:
    • Changed ValidateSet tag from 'vs2022' to 'vs2026'
    • Updated minimum VS version from 17.11.0 to 18.0.0
    • Updated WinGet package references from Microsoft.VisualStudio.2022.* to Microsoft.VisualStudio.2026.*
    • Updated display name from "Visual Studio 2022" to "Visual Studio 2026"
  • Updated VS project files (following VS2019→VS2022 upgrade pattern from commit 5885ee4):
    • 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/telemetry packages)

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 5885ee4.

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 --logging won'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 installed

Expected 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.js solved the problem for me (for anybody interested).
Obviously this isn't a solution, as proper support should be added, but a escape hatch

CLI 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)


✨ 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

@protikbiswas100 protikbiswas100 marked this pull request as ready for review November 27, 2025 04:25
@protikbiswas100 protikbiswas100 requested review from a team as code owners November 27, 2025 04:25
@protikbiswas100
Copy link
Contributor

/azp run

Copilot AI changed the title [WIP] Fix missing Visual Studio 2026 support for React Native CLI Update Visual Studio to 2026 in CI pipeline builds Nov 27, 2025
Copilot finished work on behalf of protikbiswas100 November 27, 2025 04:25
@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

"parameters": {
"Workloads": "--add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NativeDesktop --add Microsoft.VisualStudio.Workload.Universal --add Microsoft.Component.MSBuild --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.ComponentGroup.UWP.Support --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core --add Microsoft.VisualStudio.Component.Windows10SDK.19041 Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.ComponentGroup.UWP.VC --includeRecommended --includeOptional",
"SKU": "Enterprise",
"VSBootstrapperURL": "https://aka.ms/vs/18/release/vs_Enterprise.exe"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the correct URL for getting the VS exe file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, https://aka.ms/vs/18/release/vs_Enterprise.exe follows the standard VS bootstrapper URL format where the version number (18) corresponds to VS2026. This is consistent with previous versions like VS2022 using aka.ms/vs/17/release/.


pool:
vmImage: windows-2022
vmImage: windows-2025
Copy link
Contributor

@protikbiswas100 protikbiswas100 Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it windows-2025 instead of 2026

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

windows-2026 vmImage doesn't exist in Azure DevOps hosted agents. The latest available image is windows-2025 (Windows Server 2025). The VS version is separate from the Windows OS version - we're installing VS2026 on a Windows 2025 server via the custom agent image configuration.

@protikbiswas100
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@protikbiswas100 protikbiswas100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You alkso need to update to vs-2026 from vs-2022 in vnext/Scripts/rnw-dependencies.ps1

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Nov 27, 2025
Copy link
Contributor Author

Copilot AI commented Nov 27, 2025

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"

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Nov 27, 2025
Copilot finished work on behalf of protikbiswas100 November 27, 2025 04:45
@protikbiswas100
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

Copy link
Contributor

@protikbiswas100 protikbiswas100 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add chnage file

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Nov 27, 2025
Copilot AI requested a review from protikbiswas100 December 1, 2025 04:45
protikbiswas100

This comment was marked as spam.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Dec 1, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Dec 1, 2025
Copilot AI requested a review from protikbiswas100 December 1, 2025 04:57
Copilot finished work on behalf of protikbiswas100 December 1, 2025 04:57
@protikbiswas100
Copy link
Contributor

@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 5885ee4#diff-c22885d97fa21ad974a3f5f982d92b6f45edc251fd34bc14223492ebd7391245

@microsoft microsoft deleted a comment from Copilot AI Dec 1, 2025
@microsoft microsoft deleted a comment from Copilot AI Dec 1, 2025
Copy link
Contributor

@iamAbhi-916 iamAbhi-916 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

protikbiswas100

This comment was marked as off-topic.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Dec 1, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Dec 1, 2025
@microsoft microsoft deleted a comment from azure-pipelines bot Dec 1, 2025
Copilot AI requested a review from protikbiswas100 December 1, 2025 11:36
Copilot finished work on behalf of protikbiswas100 December 1, 2025 11:36
@protikbiswas100
Copy link
Contributor

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?

@microsoft microsoft deleted a comment from Copilot AI Dec 1, 2025
@microsoft microsoft deleted a comment from azure-pipelines bot Dec 1, 2025
@protikbiswas100
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@protikbiswas100
Copy link
Contributor

added change in a new PR #15426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Attention 👋 An issue that had been tagged "Needs: Author Feedback" has received activity (label applied by bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Visual Studio 2026 support

4 participants