Error compiling generated visual studio project from UE4

Issue: Generated Visual Studio solution won’t compile

**Expected: **
Menu - File/Generate Visual Studio Project should compile without any error

Steps to reproduce: Select Menu - File/Generate Visual Studio Project.
Open the generated solution in VC++ 2017.
Trying to build the project from VC++ IDE produce the following errors.

1>------ Build started: Project: MyProject1, Configuration: Development_Editor x64 ------
1>Creating makefile for MyProject1Editor (no existing makefile)
1>Building MyProject1Editor...
1>Using Visual Studio 2017 14.10.25017 toolchain (D:\Apps\VS2017\VC\Tools\MSVC\14.10.25017) and Windows 10.0.14393.0 SDK (C:\Program Files (x86)\Windows Kits\10).
1>Building 6 actions with 8 processes...
1>  [1/6] SharedPCH.Engine.ShadowErrors.cpp
1>d:\apps\unreal engine 4\ue_4.24\engine\source\runtime\core\public\Windows/WindowsPlatformCompilerSetup.h(21): error C2338: Visual Studio 2017 version 15.6 is required to compile on Windows. Please install updates through the Visual Studio installer.
1>D:\Apps\VS2017\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command ""D:\Apps\Unreal Engine 4\UE_4.24\Engine\Build\BatchFiles\Build.bat" MyProject1Editor Win64 Development -Project="D:\Apps\Unreal Engine 4\UE Projects\MyProject1\MyProject1.uproject" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.
1>Done building project "MyProject1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========