4.23.1 Package Unable To Compile with Target.cs issue

I’ve managed to solve my issue with the help of a good friend. Relating to FreezerNick’s answer, turns out starting your project name with a number may not be advisable. Since my project didn’t have C++ files, I also had to create one (can be any class, just to generate the Source folder). These are the steps to what I did (sorry if it’s missing some things, I can’t remember every detail):

Make sure your UE4 is closed by checking the Task Manager, close UnrealCEFSubProcess if it’s there

  1. Add a C++ class to your project (File-> Create C++ Class, create anything). This should generate a Source folder in your root folder if you didn’t have one.
  2. Rename any non-.UASSET reference (mostly anything outside of your Content folder) of your project name to something else that starts with letters. (E.g “99RedBalloons” to “NinetyNineRedBalloons”)
  • Rename .uproject file

  • Right click .uproject file, edit with Notepad/Notepad++, rename

  • Go to Config folder, find references in DefaultGame.ini and DefaultEngine.ini, rename

  • Open the Source folder in your root folder and repeat. ANY reference of your old project name, whether it’s a folder, a .cs file, inside the .cs file, .cpp and header files, inside those files, anything.

  • Right click .uproject file and generate Visual Studio project files

  • Open the .sln file

  • Go to the Build tab at the top, Clean Solution, then Rebuild Solution. There might be some errors regarding plugins, delete the Binaries and Intermediate folders in your Plugins (e.g I have AdvancedSessions and SteamAdvancedSessions, so it would be Plugins->AdvancedSessions->AdvancedSessions->Delete Binaries and Intermediate.) Any error that shows MISSING UCLASS NAME is referring to your old project name, so double click it and rename.

  • Open the .uproject file. If it asks to rebuild, click Yes

  • Package

==========================================================================================
Again, this worked for me because my project name started with a number, so I would not advise using this approach if your predicament isn’t similar.