4.20 cannot find visual studio 2017

For some reason 4.20 cannot open or edit c++ files unless I set the editor to Visual Studio Code. This never used to be a problem. I get this error when trying to open visual studio 2017 within unreal.

Discovering modules, targets and
source code for project… F:\Epic
warning: Referenced directory ‘F:\Epic
does not exist.

Uninstalled visual studio and installed it through Unreal and now it works.

What do you mean by “installed it through Unreal”?
I have the same problem as you and can’t figure out how to fix that

I think he means:
Uninstall Visual Studio,
Open Unreal Engine,
Create a C++ project,
Unreal should prompt you that you need to install Visual Studio before making the Project and give you a link to it.

I have a few VSs installed. However, I fixed the problem in a different way. Instead of trying to build from sources on the Epic Games Launcher build, I build from sources from on the GitHub version. No problems there.

It’s a possible solution but your method installs VS Community edition. If we already have a paid subscription to VS, it simply ignores it.