diff --git a/windows/test-app.js b/windows/test-app.js index b98f4da43..428c61523 100755 --- a/windows/test-app.js +++ b/windows/test-app.js @@ -711,6 +711,22 @@ function generateSolution(destPath, { autolink, useHermes, useNuGet }) { } ); + // TODO: Remove when we drop support for 0.67. + // Patch building with Visual Studio 2022. For more details, see + // https://github.com/microsoft/react-native-windows/issues/9559 + if (rnWindowsVersionNumber < 6800) { + const dispatchQueue = path.join( + rnWindowsPath, + "Mso", + "dispatchQueue", + "dispatchQueue.h" + ); + copyAndReplace(dispatchQueue, dispatchQueue, { + "template \\s*inline void MustBeNoExceptVoidFunctor\\(\\) {\\s*static_assert\\(false": + "namespace details {\n template \n constexpr bool always_false = false;\n}\n\ntemplate \ninline void MustBeNoExceptVoidFunctor() {\n static_assert(details::always_false", + }); + } + if (useNuGet) { const nugetConfigPath = findNearest(