When compiling engine source of v4.22,

.NET Framework 4.6.2 Developer Pack must be intalled.

Error when execute GenerateProjectFiles.bat:

Setting up Unreal Engine 4 project files...
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets
(1179,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.2" were not found. To resol
ve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the
framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global
 Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly t
argeted for the framework you intend. [F:\EpicGames\UnrealEngine-4.22.0-release\Engine\Source\Programs\UnrealBuildTool\
UnrealBuildTool.csproj]

Solution:
Intall this .NET Framework 4.6.2 Developer Pack
https://www.microsoft.com/en-us/download/details.aspx?id=53321

Reference
https://stackoverflow.com/questions/44548780/the-reference-assemblies-for-framework-netframework-version-v4-6-2-were-not-f/44549053


人生没有闲,闲是临阵脱逃。──顾随