I just finished building Unreal from source, but I didn’t realize that I had accidentally generated project files for VS 2019 instead of 2022. So I updated BuildConfiguration.xml to use VisualStudio2022 (as it says if you do -2022) and tried to rerun GenerateProjectFiles.bat, but no matter what I do I get the following error or something similar:
Discovering modules, targets and source code for project...
Binding IntelliSense data...
Binding IntelliSense data... 100%
Writing project files...
Available x64 toolchains (4):
* C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.35.32124
(Family=14.35.32124, FamilyRank=2, Version=14.35.32124, Is64Bit=True, Preview=True, Architecture=x64, Error=False)
* C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933
(Family=14.34.31933, FamilyRank=2, Version=14.34.31937, Is64Bit=True, Preview=True, Architecture=x64, Error=False)
* C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629
(Family=14.33.31629, FamilyRank=1, Version=14.33.31631, Is64Bit=True, Preview=True, Architecture=x64, Error=False)
* C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705
(Family=14.30.30705, FamilyRank=2, Version=14.30.30711, Is64Bit=True, Preview=True, Architecture=x64, Error=False)
Writing project files... 0%
Unable to find valid latest C++ toolchain for VisualStudio2022 x64
I’ve tried changing the WindowsPlatform.CompilerVersion attribute in BuildConfiguration.xml, but if I enter Latest, Preview, or any of the version numbers from above, i get that exact error. If I enter a non-existent version (for example 987354) it changes to Unable to find valid 987354 C++ toolchain for VisualStudio2022 x64
, so it is at least recognizing my configuration.
There is this thread of someone with a similar issue:
https://forums.unrealengine.com/t/unable-to-generate-vs-project-files-for-5-1/717750
The difference is that is says exactly which version its looking for and it worked after he installed it. I have the specified version installed and its giving me this error. He’s also just trying to generate project files for a game, but I’m trying to regenerate project files for the source.
I’m sure there’s a simple solution, something I need to delete, something to install, a setting or argument to change, but I cannot figure it out.
Extra info:
I’m using Visual Studio 17.5.0 Preview 2.0
You can see the versions of the MSVC x86/x64 toolchain I have installed above
Using Unreal Engine 5.1 from the Github release branch from January 13