When building the Unreal Engine from the Github source in Visual Studio 2022, the compilation failed due to missing file errors.

An example error:

Cannot open include file: '../Plugins/Developer/Concert/ConcertApp/MultiUserClient/Source/MultiUserClient/Private/Widgets/ActiveSession/Replication/Client/Multi/Columns/AssignedClients/MultiStreamColumns_AssignedClients.cpp': No such file or directory

The issue is caused by Visual Studio 2022 being limited to paths <=260 characters by its use of the Windows C API’s MAX_PATH macro. While Windows can now support longer paths, Visual Studio is still hard-coded to follow this limit.

The solution is to put the Unreal Engine source code near the root of your hard drive e.g. C:\dev\Unreal Engine\. This will ensure no engine paths exceed the MAX_PATH limit.