Cannot Open Generated Source File

#include “PlayerCharacter.generated.h” has the following error: “cannot open source file PlayerCharacter.generated.h”.

I’ve looked around a bunch and can’t find a proper solution that works.

I’ve tried regenerating certain files but it didn’t work. The following are the steps I took:

I deleted the following files from my project folder: “.vs, Binaries, Config, Intermediate, Saved, .sln”.

After deleting the files I right clicked on the .uproject file and clicked “Generate Visual Studio project files”…

The result of generating the Visual Studio project files…

After trying to open the .uporject again I got a message saying there were missing modules and asked if I’d like them to be rebuilt, I clicked yes…

265100-4.png

After they were built I tried to open the .uproject file and got this message…

265101-6.png

I see this message occasionally and follow the same flow (delete Intermediate, regenerate VS project etc). The only thing I do differently is after regenerating the VS project, I open visual studio and hit Rebuild all.

There was an error somewhere in my source code that was causing the problem, after fixing said error I could regenerate the files properly.