Cannot generate project files after moving out of documents

Having a problem trying to generate visual studio project files.
I used to have my project files in my documents folder on my D: Drive.
Now i want to move it to my E: Drive because my D: Drive is slow.
But after i moved the project files over and run the Generate Visual Studio Project Files context command this happens:

Running E:/UnrealEngine/UE_4.20/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="E:/Unreal Engine Projects/TestProject/TestProject.uproject" -game -rocket -progress -log=E:\Unreal Engine Projects\TestProject/Saved/Logs/UnrealVersionSelector-2018.10.23-03.36.37.log
Discovering modules, targets and source code for project...
ERROR: UnrealBuildTool Exception: Couldn't find target rules file for target 'TestProject' in rules assembly 'UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
       Location: E:\UnrealEngine\UE_4.20\Engine\Intermediate\Build\BuildRules\UE4Rules.dll
       Target rules found:

Though if it’s on my D: Drive everything is just fine…
Using VS2017.
Have tried getting rid of (i.e. moving/renaming) Binaries, Intermediate, and Saved to no avail.

XPost on reddit: https://www.reddit.com/r/unrealengine/comments/9s7lkf/cannot_compile_anything/

I move projects around across hard disks and don’t get this issue. The error seems to come from the version selector. What does it say? (Saved/Logs/UnrealVersionSelector-…)

Try removing these as well

.vs/
*.sln
*.suo
Binaries/
Intermediate/
Saved/

Then choose switch UE4 version so it rewrites the uproject file and then rebuilds it. If it doesn’t fix the issue, then post the content of the version selector log file mentioned in the error message you posted above

removed those and still get that kind of error:

Running E:/UnrealEngine/UE_4.20/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="E:/Unreal Engine Projects/TestProject/TestProject.uproject" -game -rocket -progress -log=E:\Unreal Engine Projects\TestProject/Saved/Logs/UnrealVersionSelector-2018.10.23-14.37.08.log
Discovering modules, targets and source code for project...
ERROR: UnrealBuildTool Exception: Couldn't find target rules file for target 'TestProject' in rules assembly 'UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
       Location: E:\UnrealEngine\UE_4.20\Engine\Intermediate\Build\BuildRules\UE4Rules.dll
       Target rules found:

Folder Structure:

/Config
/Content
/Source
/TestProject.png
/TestProject.uproject

Also, there’s no Saved folder in the project folder nor in my unreal engine folder.

ok, i think i got it working.
Apparently UnrealVersionSelector SUCKS when dealing with different unreal engine versions that are not in the same folder AS that program…
So what i did was create 4 bat files and copied UnrealVersionSelector INTO the root of an unreal engine install. i.e. E:\UnrealEngine\UE_4.20\UnrealVersionSelector
So with that in mind, the 4 bat files are just “UnrealVersionSelector.exe [option] %1”.
where [option] is:
/editor - run the editor
/projectfiles - generate project files
/game - run the game
/switchversion - switch editor version
Due not that UnrealVersionSelector NEEDS to be in the root of an engine install otherwise it complains about it not finding the Engine folder…

ok, that didnt work…

After doing a clean reinstall of my os, i still cant compile the github version of Unreal Engine 4.20…
Pastebin of build log: Unreal Engine source build log. - Pastebin.com
It complains about missing files but i can find them fine, so i have no clue what’s wrong…

and now i cant compile jack…
Constant cannot open source file saying it cant find them even though they are there…

and this from trying to create a new project:

Running E:/UnrealEngine/UE_4.20/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Win64 -Project="D:/Users/alatn/Documents/Unreal Projects/OpenDiva/OpenDiva.uproject" -TargetType=Editor -Progress -NoHotReloadFromIDE
Performing full C++ include scan (building a new target)
Creating makefile for OpenDivaEditor (no existing makefile)
Using Visual Studio 2017 14.15.26726 toolchain (D:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.15.26726) and Windows 10.0.17763.0 SDK (D:\Program Files (x86)\Windows Kits\10).
@progress push 5%
Parsing headers for OpenDivaEditor
  Running UnrealHeaderTool "D:\Users\alatn\Documents\Unreal Projects\OpenDiva\OpenDiva.uproject" "D:\Users\alatn\Documents\Unreal Projects\OpenDiva\Intermediate\Build\Win64\OpenDivaEditor\Development\OpenDivaEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
Reflection code generated for OpenDivaEditor in 12.0104824 seconds
@progress pop
Building 8 actions with 8 processes...
  @progress 'Compiling C++ source code...' 0%
  @progress 'Compiling C++ source code...' 12%
  [1/8] PCLaunch.rc
  @progress 'Compiling C++ source code...' 25%
  [2/8] SharedPCH.Engine.cpp
  c1xx: fatal error C1083: Cannot open source file: 'D:\Users\alatn\Documents\Unreal Projects\OpenDiva\Intermediate\Build\Win64\OpenDivaEditor\Development\Engine\SharedPCH.Engine.cpp': No such file or directory
ERROR: UBT ERROR: Failed to produce item: D:\Users\alatn\Documents\Unreal Projects\OpenDiva\Binaries\Win64\UE4Editor-OpenDiva.dll
       (see ../Programs/UnrealBuildTool/Log.txt for full exception trace)
Total build time: 88.99 seconds (Parallel executor: 0.00 seconds)

Try verifying the engine installation (Launcher > Engine 4.20 > Verify)

nogo. tried that and a reinstall of VS2017 and still get files that the compiler cant find even though they are there…

Figured it out.
Turns out that if you use Windows Subsystem for Linux and any form of file usage through it (i.e. cp, rsync, git, etc) will cause this error.
It’s because apparently of case sensitivity between linux and windows.

Reference: Visual Studio Feedback