|Unreal Engine 5.7 + Visual Studio 2026| Build Engine From Source

This is a quick and definitely dirty fix for anyone trying to build UE 5.7 (5.7.0-release Git Tag to be specific.) with Visual Studio 2026 on Windows 11.

For now I have found, that the GenerateProjectFiles.bat script does not work because the UnrealBuildTool gets Compiler and Toolchain versions from configuration files which ask for VisualStudio2022. If you only have Visual Studio 2026, then in a file called VCEnvironment.cs located at Engine/Source/Programs/UnrealBuildTool/Platform/Windows/VCEnvironment.cs simply add the lines as below. This way you can generate the engine’s project files with GenerateProjectFiles.bat.

1 Like

TLDR: This is for anyone getting the error, “Visual Studio 2022 x64 must be installed in order to build this target.“ while building the engine from source.

(post deleted by author)

thanks @8Zerocool8 ,

yes , I checked just now, re-assign the enum variable “Compiler” to “WindowsCompiler.VisualStudio2022” before this code:
( file:VCEnvironment.cs , line 520 )

WindowsPlatform.TryGetToolChainDir(….)

successfully generate project files, time to say goodbye to VisualStudio2022….