How can I resolve the error "Couldn't find target rules file for target 'MyProjectName'" when building a project?

I am going to guess you have got this answered after 6 months but I’m replying so if others encounter the same issue they can at least reference this comment.

So, “yes” is effectively my answer. However the image in madmaurice’s post shows far more files that I have in that directory. In fact in the root of my install dir there are NO FILES, just folders although they do match the ones shown above (Engine/Projects/Samples/Templates).

My boot drive is "D:" and my UE is installed “D:\Program Files\Epic Games\UE_4.14” - my projects directory (for everything not just UE) is “D:\Projects”.

If I create a file called Games.uprojectdirs (all I did was right click, create text file, edited the filename) and add in one line…

D:\Projects\Unreal

…then save it, my project will not only open and compile it will bring up the Editor and VS - something it did not before the addition of this file. No longer do I get the “ERROR: Couldn’t find target rules file for target” prompt.

So for you, if you still have that issue, you would just change the D:\Projects\Unreal to G:\Projects\MyProject (remember back slashes in the OS, forward slashes for web addresses).

Hope this comment helps someone because I spent a week tearing my hair out trying to get this working and there is very little documentation to tell you about the Games.uprojectdirs file.