Problems with unreal build tool on master

I am having problems with building master as of today and haven’t seen a bug report for it.

bug:

Setting up Unreal Engine 4 project files...
Binding IntelliSense data... 100%
Writing project files... 0%
UnrealBuildTool Exception: System.InvalidOperationException: There is an error in XML document (0, 0). ---> System.Xml.X
mlException: Root element is missing.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlReader.MoveToContent()
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderList1.Read3_ArrayOfEnvVar()
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events) 
   at UnrealBuildTool.Utils.SetEnvironmentVariablesFromBatchFile(String BatchFileName) in d:\UE\Engine\Source\Programs\UnrealBuildTool\System\Utils.cs:line 246
   at UnrealBuildTool.VCEnvironment..ctor(CPPTargetPlatform InPlatform) in d:\UE\Engine\Source\Programs\UnrealBuildTool\Windows\VCEnvironment.cs:line 73
   at UnrealBuildTool.VCEnvironment.SetEnvironment(CPPTargetPlatform Platform) in d:\UE\Engine\Source\Programs\UnrealBuildTool\Windows\VCEnvironment.cs:line 48
   at UnrealBuildTool.VCToolChain.GetVCIncludePaths(CPPTargetPlatform Platform) in d:\UE\Engine\Source\Programs\UnrealBuildTool\Windows\VCToolChain.cs:line 1677
   at UnrealBuildTool.VCProjectFile.WriteProjectFile(List`1 InPlatforms, List`1 InConfigurations) in d:\UE\Engine\Source\Programs\UnrealBuildTool\System\VCProject.cs:line 336
   at UnrealBuildTool.ProjectFileGenerator.WriteProjectFiles() in d:\UE\Engine\Source\Programs\UnrealBuildTool\System\ProjectFileGenerator.cs:line 2013
   at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(String[] Arguments, Boolean& bSuccess) in d:\UE\Engine\Source\Programs\UnrealBuildTool\System\ProjectFileGenerator.cs:line 604
   at UnrealBuildTool.UnrealBuildTool.GenerateProjectFiles(ProjectFileGenerator Generator, String[] Arguments) in d:\UE\Engine\Source\Programs\UnrealBuildTool\System\UnrealBuildTool.cs:line 1238
   at UnrealBuildTool.UnrealBuildTool.Main(String[] Arguments) in d:\UE\Engine\Source\Programs\UnrealBuildTool\System\UnrealBuildTool.cs:line 1085

GenerateProjectFiles ERROR: UnrealBuildTool was unable to generate project files.

I also tried the following:

> git reset --hard epic/master
HEAD is now at 97e02a9 Cis fix, new stat: EKismetCompilerStats_RefreshDependentBlueprintsInReinstancer
> git pull epic master
Already up-to-date.

I’m having the same problems, I also notice error CS0241 when trying to generate the project files. “Default parameter specifiers are not permitted”

Yes, also having the same problem here on two different machines, this is the decks day out fits not work anymore

I’ve used git-bisect to find the culprit (and to work with the last commit before the bug).

Problem come from the commit a80f7b84c443b4a0db748fbd56ca84369d1d940d on master branch:

Author: Steve Robb <Steve.Robb@epicgames.com>
Date:   Tue Mar 24 07:06:06 2015 -0400

Replacement method for harvesting environment variables.  Should handle non-ASCII and avoid other problems with set,

https://answers.unrealengine.com/questions/193930/vc-directories-not-set-on-start-causing-2-errors.html

#codereview robert.manuszewski

[CL 2489104 by Steve Robb in Main branch]

A newer question point to the exact same commit: see [4.8] GenerateProjectFiles.bat -> UnrealBuildTool Exception - AnswerHub - Unreal Engine Forums

Temporary Fix!!

It seems the program that generates the XML has not been added to the actual UE4 build. Here is the fix

  1. Go to \Engine\Source\Programs\EnvVarsToXML open the SLN and build it

  2. that will make a directory in \Engine\Source\Binaries\DotNET copy all 6 files in there

  3. Paste all files to \Engine\Binaries\DotNET

This will fix the errors

P.s you can probably get away with not including the 3 vhost files, just the first 3

Should now be fixed by:

https://github.com/EpicGames/UnrealEngine/commit/0aea4571125f61da51ef9770a79a18ce691c2c86

Steve