Visual Studio stops compiling after a while

Using 4.18 preview 3, Visual Studio stops compiling after a certain number of compiles.

Using Visual Studio 2015 Update 3.

The output in Visual Studio is as follows:

1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Build started: Project: VrPluginDev, Configuration: Development_Editor x64 ------
2>EXEC : error : System.ArgumentNullException: Value cannot be null.
2> Parameter name: source
2> at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate)
2> at UnrealBuildTool.ExternalExecution.ExecuteHeaderToolIfNecessary(BuildConfiguration BuildConfiguration, UEBuildTarget Target, CppCompileEnvironment GlobalCompileEnvironment, List`1 UObjectModules, FileReference ModuleInfoFileName, ECompilationResult& UHTResult)
2> at UnrealBuildTool.UnrealBuildTool.RunUBT(BuildConfiguration BuildConfiguration, String[] Arguments, FileReference ProjectFile)
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command ““C:\Program Files (x86)\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat” VrPluginDevEditor Win64 Development “C:\Barog\DungeonRaider\VrPluginDev\VrPluginDev.uproject” -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

One this is started happening, it happens every compilation attempt. Restarting Visual Studio, or reopening the project has no effect, but recreating the project from the uproject puts everything back into a working state for a while.

Just to update on the frequency, it generally seems to happen after several compiles, but I have just had it occur after one successful compilation attempt. The output in that case was:

1>------ Build started: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>------ Build started: Project: VrPluginDev, Configuration: Development_Editor x64 ------
2>EXEC : error : System.ArgumentNullException: Value cannot be null.
2> Parameter name: source
2> at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate)
2> at UnrealBuildTool.ExternalExecution.ExecuteHeaderToolIfNecessary(BuildConfiguration BuildConfiguration, UEBuildTarget Target, CppCompileEnvironment GlobalCompileEnvironment, List`1 UObjectModules, FileReference ModuleInfoFileName, ECompilationResult& UHTResult)
2> at UnrealBuildTool.UnrealBuildTool.RunUBT(BuildConfiguration BuildConfiguration, String[] Arguments, FileReference ProjectFile)
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.MakeFile.Targets(41,5): error MSB3075: The command ““C:\Program Files (x86)\Epic Games\UE_4.18\Engine\Build\BatchFiles\Build.bat” VrPluginDevEditor Win64 Development “C:\Barog\DungeonRaider\VrPluginDev\VrPluginDev.uproject” -waitmutex” exited with code 5. Please verify that you have sufficient rights to run this command.
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

After regenerating the project again, multiple compilations have run okay, so I’m not sure why this happened after just one.

This is a known issue. It started with 4.17 and it was fixed but came back in 4.18.

https://forums.unrealengine.com/development-discussion/engine-source-github/124586-annoying-compile-issue-in-4-17-preview-3?p=1362719#post1362719

Workaround is to right click on uproject and select Generate Visual Studio Project files.

Thanks, I’d not found it on the forums or here so thought it best to log it.