New UE5 c++ project cannot find header files and open source file in visual studio 2019

I fixed this by upgrading the windows 10 sdk. In VS installer, select game development, and uncheck win10 sdk 19.something and select the latest win10 sdk which for me was 22.something. You can probably leave 19 installed if you need it, but I didn’t.