Visual Studio C++ 2017 installation not found

For the last few days, any time I try and create a new C++ project or open a project that needs to be rebuilt, I am unable to build the project as Unreal says it cannot find the installation folder of Visual Studio 2017.

This is the error message I get when trying to build:

An error occurred while trying to generate project files.

Running D:/Programs/Epic Games/UE_4.20/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“D:/Users/legoj/OneDrive/School/GAM/Game Design 2/MyProject/MyProject.uproject” -game -rocket -progress
Discovering modules, targets and source code for project…
WARNING: Visual Studio C++ 2017 installation not found - ignoring preferred project file format.
WARNING: Exception while generating include data for UE4Editor: Visual Studio 2017 must be installed in order to build this target.
Binding IntelliSense data… 0%@progress ‘Binding IntelliSense data…’ 50%
WARNING: Exception while generating include data for MyProjectEditor: Visual Studio 2017 must be installed in order to build this target.
Binding IntelliSense data… 50%@progress ‘Binding IntelliSense data…’ 100%
ERROR: UnrealBuildTool Exception: Visual Studio 2015 must be installed in order to build this target.

I’ve tried everything short of resetting my laptop: installing the relevant sections of Visual Studio 2017 (Game Development with C++, Unreal Installer, .NET Development, multiple SDK’s), uninstalling and reinstalling both VS and UE, checking editor settings, following the tips and suggestions of similar issues, but nothing seems to be working. I can’t figure out why Unreal can’t find VS 2017 installation folder, and even when a solution gets partially created and I open it in VS it fails to build.

What more can I do without resetting my laptop? I’m at my wits end trying to fix this and I have no idea what to try next,

Did you ever find the solution to this? I am having this problem with both VS 2017 and 2019, UE4.22 and 4.23