Menu Close
How Can We Help?
You are here:
Print

Use VS2022 with older Unreal Engine 4 Source

Overall is simple to use VS2022 with older UE4 versions, I build UE4.23.1 from source without problems, I can use and build my C++ projects without problems. The only problem is that inside UE4 the engine complain that it cannot find VisualStudio (“No compiler was found”) even when running UE4 in debug mode inside VS2022.

The solution is actually pretty simple, just edit the source code as described below:

File:
Engine\Plugins\Developer\VisualStudioSourceCodeAccess\Source\VisualStudioSourceCodeAccess\Private\VisualStudioSourceCodeAccessor.cpp
Line 1227, replace:
if (true) //(FCString::Strncmp(InstallationVersion, VersionPrefix, VersionPrefixLen) == 0)

This IF code in VisualStudioSourceCodeAccessor.cpp is meant to verify if the VisualStudio found is the same supported Version, so VS2022 is version 17, VS2019 is version 16, so VS2017 is version 15, and so on…

Since is alreay unsupported to use VS2022 with older UE4, just bypass this check and it doesn’t matter anymore, UE4 will accept your VS and everything will work fine.

Comments are welcome.