Skip to content

Commit 5885ee4

Browse files
authored
Upgrade to VS 2022 (#9916)
*Description* This PR updates RNW to build with (and require) Visual Studio 2022. This includes upgrading the `Microsoft.ReactNative.Managed.CodeGen` project to .NET 6.0 This PR does not change the minimum / target Windows SDK versions for RNW or RNW apps. This PR does not change the language versions of C++ (17) and C# (8.0) used. *Type of Change* - Breaking change (fix or feature that would cause existing functionality to not work as expected) - This change requires a documentation update *Why* Visual Studio 2022 is the currently supported version of Visual Studio and what is available to download without an MSDN subscription to access older versions. As Visual Studio 2019 support is reduced/deprecated, we need to migrate. Closes #8750 Closes #9499 Closes #10130 *What* What's changed: * All VS project files have been updated to require a minimum of VS 2022 (aka version 17.0). * NuGet-based dependencies that are tied to VS version have been upgraded. * The `Microsoft.ReactNative.Managed.CodeGen` project has been updated to .NET 6.0 * The snapshots for the codegen tests have been updated to pass * The E2E Test app has been updated to the latest version of `react-native-xaml` (needed to fix build issues) * Snapshots for E2E tests have been updated to pass *Testing* Builds and tests All tests
1 parent 10e9788 commit 5885ee4

File tree

152 files changed

+967
-832
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+967
-832
lines changed

.ado/compliance.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ parameters:
66
default:
77
Medium:
88
name: rnw-pool-4-microsoft
9-
demands: ImageOverride -equals rnw-img-node16
9+
demands: ImageOverride -equals rnw-img-vs2022
1010
Large:
1111
name: rnw-pool-8-microsoft
12-
demands: ImageOverride -equals rnw-img-node16
12+
demands: ImageOverride -equals rnw-img-vs2022
1313
- name: forceCodeQL
1414
displayName: Force CodeQL to rebuild databases
1515
type: boolean

.ado/continuous.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ parameters:
1313
default:
1414
Small:
1515
name: rnw-pool-2
16-
demands: ImageOverride -equals rnw-img-node16
16+
demands: ImageOverride -equals rnw-img-vs2022
1717
Medium:
1818
name: rnw-pool-4
19-
demands: ImageOverride -equals rnw-img-node16
19+
demands: ImageOverride -equals rnw-img-vs2022
2020
Large:
2121
name: rnw-pool-8
22-
demands: ImageOverride -equals rnw-img-node16
22+
demands: ImageOverride -equals rnw-img-vs2022
2323

2424
stages:
2525
- template: stages.yml

.ado/image/rnw-pool.json

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,71 @@
11
{
22
"imageType": "Managed",
3-
"baseImage": "/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest",
3+
"baseImage": "/MicrosoftWindowsServer/WindowsServer/2022-Datacenter/latest",
44
"artifacts": [
55
{
6-
"Name": "windows-EnableDeveloperMode"
6+
"name": "windows-EnableDeveloperMode"
77
},
88
{
9-
"Name": "windows-enable-long-paths"
9+
"name": "windows-enable-long-paths"
1010
},
1111
{
12-
"Name": "windows-gitinstall"
12+
"name": "windows-gitinstall"
1313
},
1414
{
15-
"Name": "windows-AzPipeline-ImageHelpers"
15+
"name": "windows-AzPipeline-ImageHelpers"
1616
},
1717
{
18-
"Name": "windows-AzPipeline-InitializeVM"
18+
"name": "windows-AzPipeline-InitializeVM"
1919
},
2020
{
21-
"Name": "windows-AzPipeline-Install-VS",
22-
"Parameters": {
23-
"ToolSetFileName": "2019-default.json"
21+
"name": "windows-AzPipeline-powershellCore"
22+
},
23+
{
24+
"name": "windows-AzPipeline-7zip"
25+
},
26+
{
27+
"name": "windows-visualstudio-bootstrapper",
28+
"parameters": {
29+
"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 --add Microsoft.VisualStudio.ComponentGroup.UWP.VC --includeRecommended --includeOptional",
30+
"SKU": "Enterprise",
31+
"VSBootstrapperURL": "https://aka.ms/vs/17/release/vs_Enterprise.exe"
32+
}
33+
},
34+
{
35+
"name": "Windows-NodeJS",
36+
"parameters": {
37+
"Version": "16.13.0"
2438
}
2539
},
2640
{
27-
"Name": "windows-AzPipeline-NodeLts"
41+
"name": "windows-npm-global",
42+
"parameters": {
43+
44+
"addToPath": true
45+
}
46+
},
47+
{
48+
"name": "windows-chrome"
2849
},
2950
{
30-
"Name": "windows-chrome"
51+
"name": "windows-AzPipeline-WinAppDriver"
3152
},
3253
{
33-
"Name": "windows-AzPipeline-WinAppDriver"
54+
"name": "windows-dotnetcore-sdk",
55+
"parameters": {
56+
"DotNetCoreVersion": "2.1.818"
57+
}
58+
},
59+
{
60+
"name": "windows-dotnetcore-sdk",
61+
"parameters": {
62+
"DotNetCoreVersion": "3.1.412"
63+
}
3464
},
3565
{
36-
"Name": "windows-dotnetcore-sdk",
37-
"Parameters": {
38-
"DotNetCoreVersion": "3.1.401"
66+
"name": "windows-dotnetcore-sdk",
67+
"parameters": {
68+
"DotNetCoreVersion": "6.0.401"
3969
}
4070
}
4171
],
@@ -47,4 +77,4 @@
4777
}
4878
]
4979
}
50-
}
80+
}

.ado/integrate-rn.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ variables:
1414
- group: RNW Secrets
1515

1616
pool:
17-
vmImage: windows-2019
17+
vmImage: windows-2022
1818

1919
jobs:
2020
- job: IntegrateRN

.ado/jobs/desktop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ jobs:
5959
value: false
6060

6161
#5059 - Disable failing or intermittent tests (IntegrationTestHarness,AsyncStorage,WebSocket,Logging).
62-
#5265 - WebSocketModuleIntegrationTest::WebSocketModule_Ping fails for Release
62+
#10732 - WebSocketIntegrationTest::SendReceiveSsl fails on Windows Server 2022.
6363
- name: Desktop.IntegrationTests.Filter
6464
value: >
6565
(FullyQualifiedName!=RNTesterIntegrationTests::AsyncStorage)&
6666
(FullyQualifiedName!=RNTesterIntegrationTests::Blob)&
6767
(FullyQualifiedName!=RNTesterIntegrationTests::IntegrationTestHarness)&
6868
(FullyQualifiedName!=WebSocketResourcePerformanceTest::ProcessThreadsPerResource)&
69+
(FullyQualifiedName!=WebSocketIntegrationTest::SendReceiveSsl)&
6970
(FullyQualifiedName!=Microsoft::React::Test::HttpOriginPolicyIntegrationTest)
70-
7171
#6799 -
7272
# HostFunctionTest - Crashes under JSI/V8
7373
# HostObjectProtoTest - Crashes under JSI/V8

.ado/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ parameters:
1818
default:
1919
Medium:
2020
name: rnw-pool-4-microsoft
21-
demands: ImageOverride -equals rnw-img-node16
21+
demands: ImageOverride -equals rnw-img-vs2022
2222
Large:
2323
name: rnw-pool-8-microsoft
24-
demands: ImageOverride -equals rnw-img-node16
24+
demands: ImageOverride -equals rnw-img-vs2022
2525

2626
variables:
2727
- template: variables/windows.yml

.ado/templates/discover-google-test-adapter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
steps:
22

33
- powershell: |
4-
$vsExtensionPath="${env:ProgramFiles(x86)}\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\Extensions\";
4+
$vsExtensionPath="${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\";
55
$GoogleTestAdapterPath=(Get-ChildItem $vsExtensionPath -Directory | Where-Object -FilterScript {Test-Path (Join-Path -Path $_.FullName -ChildPath "GoogleTestAdapter.Core.dll")}).FullName
66
77
# Test the path to the google test adapter

.ado/templates/msbuild-sln.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ parameters:
66
# NuGet & MSBuild
77
solutionDir:
88
solutionName:
9-
msbuildVersion: 16.0
9+
msbuildVersion: 17.0
1010
msBuildArchitecture: x64
1111
preferredToolArchitecture: x64
12-
platformToolset: v142
12+
platformToolset: v143
1313
buildPlatform: x64
1414
buildConfiguration: Debug
1515
msbuildArguments: ''

.ado/windows-vs-pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ parameters:
1616
default:
1717
Small:
1818
name: rnw-pool-2
19-
demands: ImageOverride -equals rnw-img-node16
19+
demands: ImageOverride -equals rnw-img-vs2022
2020
Medium:
2121
name: rnw-pool-4
22-
demands: ImageOverride -equals rnw-img-node16
22+
demands: ImageOverride -equals rnw-img-vs2022
2323
Large:
2424
name: rnw-pool-8
25-
demands: ImageOverride -equals rnw-img-node16
25+
demands: ImageOverride -equals rnw-img-vs2022
2626

2727
stages:
2828
- template: stages.yml
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Upgrade to VS 2022",
4+
"packageName": "@react-native-windows/automation-channel",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

0 commit comments

Comments
 (0)