Unreal engine 5.2.1 error while opening CPP project:try rebuilding from source mannually

When open the CPP project in UE 5.2.1 try rebuilding from source mannually. when i right click on .uproject to create new sln file, there is no option even in open with tab. When i try to build sln file in VS 2022 this error msg occured
C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets(44,5): error MSB3073: The command ““C:\Program Files\Epic Games\UE_5.2\Engine\Build\BatchFiles\Build.bat” UnrealShadows_LOTLEditor Win64 Development -Project=“D:\Unreal projects\UnrealShadows_LOTL\UnrealShadows_LOTL.uproject” -WaitMutex -FromMsBuild” exited with code 6.

More log is needed in order to be able to identify the issue.

[Upgrade]
[Upgrade] Using backward-compatible include order. The latest version of UE has changed the order of includes, which may require code changes. The current setting is:
[Upgrade] IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_1
[Upgrade] Suppress this message by setting ‘IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2;’ in UnrealShadows_LOTLEditor.Target.cs.
[Upgrade] Alternatively you can set this to ‘EngineIncludeOrderVersion.Latest’ to always use the latest include order. This will potentially cause compile errors when integrating new versions of the engine.
[Upgrade]
Determining max actions to execute in parallel (4 physical cores, 8 logical cores)
Executing up to 4 processes, one per physical core
@progress ‘Compiling C++ source code…’ 0%
Building 24 actions with 4 processes…
@progress ‘Compiling C++ source code…’ 4%
[1/24] Resource Default.rc2
@progress ‘Compiling C++ source code…’ 8%
[2/24] Compile [x64] SharedPCH.Engine.ShadowErrors.InclOrderUnreal5_1.cpp
C:\Program Files\Epic Games\UE_5.2\Engine\Source\Runtime\CoreOnline\Public\Online\CoreOnline.h(25): fatal error C1083: Cannot open include file: ‘CoreOnline.generated.h’: No such file or directory

Yeah, i had the same issue.

Open UnrealShadows_LOTLEditor.Target.cs file and search for IncludeOrderVersion .
Value is probably EngineIncludeOrderVersion.Unreal5_1; You can change it to EngineIncludeOrderVersion.Unreal5_2; or EngineIncludeOrderVersion.Latest;

What I also had to change is DefaultBuildSettings from BuildSettingsVersion.V5; to EngineIncludeOrderVersion.Unreal5_4; but I migrated to 5.4

Then, you must do the same for UnrealShadows_LOTL.Target.cs

Here is my git diff, but again, I migrated to 5.4, so you probably need to change everything to 5_2, or use .Latest everywhere. Play with these options, and you should be good. I had to blur some stuff for legal reasons.


i changed it editor.target.cs file. This error occured agian

C:\Program Files\Epic Games\UE_5.2\Engine\Source\Runtime\CoreOnline\Public\Online\CoreOnline.h(25): fatal error C1083: Cannot open include file: ‘CoreOnline.generated.h’: No such file or directory

Are you building Engine from source?

You need to change it on the second target.cs

But, this looks really strange to me, to be honest. I would try Verify option also. It could be that UE files are corrupted, as this is part of the engine file itself, and not your project. I would even go as far as to delete the engine, and reinstall it from the scratch. But this can be time consuming. And I am not sure it would resolve it.

image

If that does not help, try this: https://www.youtube.com/watch?v=voksns8O__s

i changed it in target.cs as well but still error

Try other things I suggested. Since this is engine class, I kinda suspect something got corrupted there.

I removed all the .cpp and .h file from the source and left the file with name of the project and made the backup. Then, regenerated the visual studio file from .uproject and build it. It was successful. After opening the project in UE, i refereshed the visual studio files from tool tab and compile the project from live coding and found the exact error in a function of my .cpp which was recursive function.