Errors when run GenerateProjectFiles.bat in UWP Unreal release

im getting this error when run GenerateProjectFiles.bat building the project files:

[FONT=courier new]Setting up Unreal Engine 4 project files…
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Microsoft.Common.CurrentVersion.targets(
2041,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly “Windows”. Check to make sure
the assembly exists on disk. If this reference is required by your code, you may get compilation errors. [C:\Users\gzg
tw\Downloads\MICROSOFT_UWP_UNREAL-release_uwp\MICROSOFT_UWP_UNREAL-release_uwp\Engine\Source\Programs\UnrealBuildTool\U
nrealBuildTool.csproj]
Platform\UWP\WinMDRegistrationInfo.cs(4,7): error CS0246: The type or namespace name ‘Windows’ could not be found (are
you missing a using directive or an assembly reference?) [C:\Users\gzgtw\Downloads\MICROSOFT_UWP_UNREAL-release_uwp\MIC
ROSOFT_UWP_UNREAL-release_uwp\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj]

GenerateProjectFiles ERROR: UnrealBuildTool failed to compile.

Please help

I am getting the same error. Any help?

After carefully examining the error, I have scanned through some source files, and tried changing some values and managed to solve it. What you should do in order to fix this, navigate to:


[C:\Users\gzg
tw\Downloads\MICROSOFT_UWP_UNREAL-release_uwp\MICROSOFT_UWP_UNREAL-release_uwp\Engine\Source\Programs\UnrealBuildTool\U
nrealBuildTool.csproj]

and open the file in the text editor.

Now locate the line


<TargetPlatformVersion>8.0</TargetPlatformVersion>

and change 8.0 to 8.1. Save changes and run the .bar script again. This fixed the error for me (not really sure why…).

Go to Add Reference, under Windows Universal, Core, select Windows.Foundation. Here’s the resulting change to the project
<Reference Include=“Windows.Foundation” />

Check the following directory: C:\Program Files (x86)\10\UnionMetadata, there should be a file here called Windows.winmd. If there isn’t open the folder ‘10.0.16299.0’ (there should be folder here with some series of numbers, this will be the version of the windows 10 SDK that you currently have installed), there should be the Windows.winmd file here, copy it and paste it into the C:\Program Files (x86)\10\UnionMetadata folder.

The C:\Program Files (x86)\10\UnionMetadata directory is where the UnrealBuildTool.csproj file will look to find the Windows.winmd file if it can’t find it elsewhere.

If none of the above directories exist then you’re missing the Windows 10 SDK which you can download here:

4 Likes

This is the solution. Thanks man.