It’s clearly a bug introduced in 4.20. I don’t understand how this build was approved by QA with such a bug.
Anyway, I found out what is happening and how to solve it manually. You will have to do this everytime after you generate the project files (annoying but currently is the only way).
The problem is that the UBT is not adding the intermediate include directories to the NMakeIncludeSearchPath property in the visual studio project when it generates the project files.
Workaround:
Open the project solution
Inside Visual Studio go to Project → Properties
In configuration select “All Configurations”
In the Configuration Properties tree select NMake
Click the dropdown for the “Include Search Path” item and select “Edit…”
Click the “New Line” button at the top right of the window and add this path “…\Build\Win64\UE4Editor\Inc\YourModuleName” without the quotes.
Repeat step 6 for each c++ module in your project
Let me know if this helps you until Epic makes a hotfix for this.
Thank you so much for figuring this out. I was excited to use IntelliSense and it was extremely frustrating that it wasn’t working correctly at all. I appreciate you taking the time to make the issue and spread the solution around; hopefully Epic sees this SOON!
Edit: Also, you accidentally put a double backslash in the path before YourModuleName.
By default when you create a C++ project in UE4 one gameplay module is automatically created with the same name as your project. So you can put your project’s name there.
In bigger projects this may be different as you can add multiple gameplay modules and even editor modules.
I recommend you read the gameplay modules documentation. It’s fundamental to understand them while programming with C++ for UE4 and you may find useful to configure multiple modules when working on a medium to big sized project
Because I still had this issue today with the newest version I would like to add. Don’t forget to save the .sln. Easied way to do this is just closing VS after adding the path and it will ask you to save the file.
Open VS again and everything should be fine.