Cannot build UE 5.7 from source, Visual Studio 2022 x64 must be installed in order to build this target.

I cannot build UE 5.7.4 from source.
I’m getting this error Visual Studio 2022 x64 must be installed in order to build this target. when running generateProjectFiles.bat either through the batch file or the RMB menu
and Unable to enumerate Visual Studio installations in the log.

I have every VS studio version imaginable installed, every compiler, every MSVC 143, versions 14.44. everything.

The build still won’t budge, it claims that it doesn’t have the VS studio version required. My guess is that some sort of program cannot find these installs or is invalid. But frankly I’m out of ideas

Generating VisualStudio project files:
Unable to enumerate Visual Studio installations
Detected supported platforms: Win64, Mac, IOS, Android, Linux, LinuxArm64, TVOS, VisionOS
Adding projects for all targets…
Disallowing non-opted-in platform plugin Q:\BinariesBuildAgent\BuildAgent\work\BOC\Main_5.7\Engine\Plugins\Online\Android\AndroidFetchBackgroundDownload\AndroidFetchBackgroundDownload.uplugin
Disallowing non-opted-in platform plugin Q:\BinariesBuildAgent\BuildAgent\work\BOC\Main_5.7\Engine\Plugins\Online\Android\OnlineSubsystemGooglePlay\OnlineSubsystemGooglePlay.uplugin
Disallowing non-opted-in platform plugin Q:\BinariesBuildAgent\BuildAgent\work\BOC\Main_5.7\Engine\Plugins\Online\IOS\OnlineSubsystemIOS\OnlineSubsystemIOS.uplugin
Disallowing non-opted-in platform plugin Q:\BinariesBuildAgent\BuildAgent\work\BOC\Main_5.7\Engine\Platforms\VisionOS\Plugins\Runtime\OpenXRVisionOS\OpenXRVisionOS.uplugin
Disallowing non-opted-in platform plugin Q:\BinariesBuildAgent\BuildAgent\work\BOC\Main_5.7\Engine\Plugins\Online\Android\AndroidFetchBackgroundDownload\AndroidFetchBackgroundDownload.uplugin
Disallowing non-opted-in platform plugin Q:\BinariesBuildAgent\BuildAgent\work\BOC\Main_5.7\Engine\Plugins\Online\Android\OnlineSubsystemGooglePlay\OnlineSubsystemGooglePlay.uplugin
Disallowing non-opted-in platform plugin Q:\BinariesBuildAgent\BuildAgent\work\BOC\Main_5.7\Engine\Plugins\Online\IOS\OnlineSubsystemIOS\OnlineSubsystemIOS.uplugin
Disallowing non-opted-in platform plugin Q:\BinariesBuildAgent\BuildAgent\work\BOC\Main_5.7\Engine\Platforms\VisionOS\Plugins\Runtime\OpenXRVisionOS\OpenXRVisionOS.uplugin
Adding projects for all targets took 0.24s
Visual Studio 2022 x64 must be installed in order to build this target.
BuildException: Visual Studio 2022 x64 must be installed in order to build this target.
at UnrealBuildBase.Parallel2.ForEach[TSource](IEnumerable1 source, Action1 body, Int32 helperCount, Boolean useTasks) in D:\VirtualAlchemy\BOCMain\Engine\Source\Programs\Shared\EpicGames.Build\System\Parallel2.cs:line 119
at UnrealBuildTool.ProjectFileGenerator.AddProjectsForAllTargets(PlatformProjectGeneratorCollection PlatformProjectGenerators, List1 AllGames, List1 AllTargetFiles, String
 Arguments, List1 EngineProjects, List1 GameProjects, Dictionary2 ProjectFileToUProjectFile, Dictionary2 ProgramProjects, Dictionary`2 RulesAssemblies, ILogger Logger) in D:\VirtualAlchemy\BOCMain\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 3093
at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String
 Arguments, ILogger Logger) in D:\VirtualAlchemy\BOCMain\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 1160
at UnrealBuildTool.GenerateProjectFilesMode.ExecuteAsync(CommandLineArguments Arguments, ILogger Logger) in D:\VirtualAlchemy\BOCMain\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:line 270
at UnrealBuildTool.UnrealBuildTool.Main(String
 ArgumentsArray) in D:\VirtualAlchemy\BOCMain\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 653
WriteFileIfChanged() wrote 0 changed files of 4 requested writes.

Result: Failed (OtherCompilationError)
Total execution time: 0.80 seconds

Log_GPF.txt (9.5 KB)

All help is greatly appreciated!

Hello there @mr.kubstoff!

I would not recommend having so many VS install in parallel, you should be able to build properly with VS 2022 only. As for components, you must likely have all of them present, but it still a good practice to double-check the critical ones with the guide below:

Now, checking through your log, besides the messages you already located, I do see one additional conflict. Part of your build is running from "Q:\BinariesBuildAgent\BuildAgent\work\BOC\Main_5.7", while other sections are running at "D:\VirtualAlchemy\BOCMain".

This implies that your build cache is holding stale data from other build, which makes the engine to look for VS components in a path that doesn’t exist in the system. So, a cache clear could be the solution for all this. Locate the XmlConfigCache.bin file (should be at Engine\Intermediate\Build), and delete it. Alternatively, delete the entire Build folder, which will force the engine to rebuild.

If the issue persists, I would suggest clearing up all VS entirely from your system, then reinstalling VS 2022 only.

1 Like

Thank you for the reply, I finally managed to get it working and fortunately the VS installs were not at fault.

The final culprit was perforce, the way I upgraded the engine from git and later on had to reconcile the changes to our perforce repo, the default reconcile of perforce was incredibly slow and faulty. It missed files in the reconcile and the overall engine files on repository were half 5.5 and half 5.7 (I assume long operations are prone to connection errors)

This resulted in a very dire red herring of the compilation process claiming that it could not find the VS installations. I have no clue what file or program is exactly at fault here, but once I used a proper reconcilement tool for p4 from here p4-fast-reconcile/README.md at main · Brickadia/p4-fast-reconcile · GitHub

It found a bunch of files dropped by the initial reconcilement and everything compiled finally :smiley:

1 Like