From 3e915ed192f4d3208da4e1deb0dc15552ecdad5a Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Wed, 30 Nov 2022 13:16:05 +0100 Subject: [PATCH] fix(windows): fix random Windows build failure --- windows/test-app.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/windows/test-app.js b/windows/test-app.js index 6afa4590e..a728698ed 100755 --- a/windows/test-app.js +++ b/windows/test-app.js @@ -713,6 +713,21 @@ function generateSolution(destPath, { autolink, useHermes, useNuGet }) { }); } + // TODO: Remove when we drop support for 0.69. + // Patch building with Visual Studio 2022. For more details, see + // https://github.com/microsoft/react-native-windows/pull/10373 + if (rnWindowsVersionNumber < 7000) { + const helpers = path.join( + rnWindowsPath, + "Microsoft.ReactNative", + "Utils", + "Helpers.h" + ); + copyAndReplace(helpers, helpers, { + "inline typename T asEnum": "inline T asEnum", + }); + } + if (useNuGet) { const nugetConfigPath = findNearest(