You should get used to building your project via VS if you’re working with C++. Instead of the .uproject file, open up the .sln file and once it loads, hit Ctrl + F5 (or alternatively you can click on that green play icon) to build your project.
If the issue persists, that means there’s a corruption and you should be able to fix it by deleting all VS related files (the .vs folder, Source folder and the .sln file) and regenerating them by opening up your .uproject file, navigating to the Tools menu, and from there creating a new C++ class. While you’re creating a new C++ class, also select the option to make it Public to generate the Public and Private folders automatically. Once that’s done, close the editor, head back to your project directory, navigate to the newly generated Source folder, under there navigate to the folder with your project name on it, and there you’ll see two folders named Public and Private. You can replace them with the original ones (as they’ll be empty) and hopefully everything will be fixed once you build your project via VS.
Disclaimer: Always make sure to have backup(s) of your project before manually adjusting the project files!!!