For what it’s worth, I had the same problem (Couldn’t find target rules file…) when creating projects outside the standard folder (my documents/unreal projects/etc.).
Rather than forcibly add MyGame to UE4.sln, you can use the uprojectdirs file mentioned above and put it in your project folder, then rebuild project files by right clicking your MyGame.uproject and selecting “Generate Visual Studio Projects”. This will correctly generate the solution files so they point to the correct targets and you can compile.
So to recap:
- Create Game.uprojectdirs textfile in the root of your project folder (e.g. /UnrealEngine/MyGame/)
- Right click MyGame.uproject, and select “Generate Visual Studio Projects” context option
- Open updated solution file
- Profit