GenerateProjectFiles.bat -2017 fails

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin\Microsoft.CSharp.CurrentVersion.targe
ts(321,5): error MSB4019: The imported project “C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuil
d\15.0\bin\Roslyn\Microsoft.CSharp.Core.targets” was not found. Confirm that the path in the declaration is co
rrect, and that the file exists on disk. [C:\SL\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csp
roj]

Roslyn folder doesn’t exist, so I tried copying a similar file into that place and then received…

C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targe
ts(1111,5): error MSB3644: The reference assemblies for framework “.NETFramework,Version=v4.5” 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. [C:\SL\UnrealEngine\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj
]

My first problem was that I did not have “desktop development with C++” installed. I now get the .NET 4.5 problem. I’m on a new laptop here, so 4.5 doesn’t exist and the installer won’t even allow me to install it.

I installed .net desktop development and now it’s working.

I get the error message says it can not find vs2017, How did you get it work?

I can confirm this error is still happening to me sometimes in 2019 when I do engine builds from source. Fix is to open up Visual Studio installer and click modify. Then you want to go to .Net Desktop Development on the right-hand side and expand that and select the .Net version it is complaining about in the error message of GenerateProjectFiles.bat.

I have attached an image to better illustrate where this is found.