Issue Creating New C++ Class

I was working on a project in UE5 but when I tried to create a new C++ class I got this message:

Message dialog closed, result: Yes, title: Message, text: Successfully added class ‘XXX’, however you must recompile the ‘MyProject’ module before it will appear in the Content Browser. Failed to generate project files.

The problem is that I don’t know how to do that. I wanted to open the project in Visual Studio but I don’t have any .sln file. I tried to Generate Visual Studio Project Files but I get an error. Now I can’t open the project anymore because it says that the module ‘MyProject’ is missing and it can’t rebuild and I have to do it manually from source.

So, what do I have to do? Am I missing something?

You’ll need to share that error you get when you try to Generate Visual Studio Project Files.
Generate Visual Studio Project Files generates the .sln file, and you need to go into that to rebuild manually from source.
Once you get the .sln, all you have to do is open it and build. Wait for it to finish building, and you’ll be good to launch the engine.

Thanks for the answer. I managed to generate the .sln file, I built it manually and…

Error MSB3073 E:\Programmi\UE_5.1\Engine\Build\BatchFiles\Build.bat Worlds_1Editor Win64 Development -Project=E:\Docs\Worlds_1\Worlds_1\Worlds_1.uproject -WaitMutex -FromMsBuild exited with code 6. Worlds_1 C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.MakeFile.Targets 44

I’ve read that a solution to this is disabling Live Coding in Editor but I can’t open the project in editor because it says I still have to rebuild manually from source.

Honestly I’m not sure.

Some resources say it may be due to too long of a path name?

If that doesn’t work, you can try deleting the .sln, binaries, and saved and then re-generating the visual studio files and attempt to build again.

On a side note- why do you have your within two folders named the same thing
image

I had the same issue and it FIXED
Follow the steps in this YouTube video and it will fix this issue