UE5 - Could not be compiled Try rebuilding from source manually

Hello !
Today I have an annoying error : I’ve accidently added a C++ class to my project and even if I didn’t used it, when I closed my project, i could not reopen it : “MyGame could not be compiled. Try rebuilding from source manually” so i deleted all code into my project “Source” folder. But it does nothing. I have Visual Studio 2019. What should I do ?

Despite I tried other things, it didn’t work.
So i just managed to copy/paste all my uassets into another project and setup all again.

I had a similar problem when I migrated a project from ue4 to ue5 or tried to create C++ classes in ue5. It was a long time ago, so I hope I remember everything correctly.

First I installed Visual Studio 2022.
To save the settings from VS2019, click in the installer on the “more” option and select “export configuration” and choose any folder where you want to save it. Then after installing VS2022 click on the “more” option and “import configuration” (select the configuration you saved earlier). However, some configs won’t transfer, but that’s fine.

Make sure that “.NET Framework”, “Windows SDK” and “MSVC v143” are installed in components.

Then Install “.NET 7.0 SDK” and “.NET 6.0 Runtime

After that projects should work fine when they have C++ classes in them.

If after that errors appear, then the UE should write what exactly is missing and what needs to be installed in the error text.

1 Like