Visual Studio bulid errors after using GenerateProjectFiles.bat

After generating a project .sln file using GenerateProjectFiles.bat compilation of several engine modules fails in VisualStudio with the of the following error:

EXEC : error : UnrealBuildTool Exception: A conflicting instance of UnrealBuildTool is already running at this location: C:\\unreal\UnrealEngine\Engine\Binaries\DotNET\UnrealBuildTool.exe. A process manager may be used to determine the conflicting process and what tool may have launched it.

This appears to affect the following modules:
TestPAL, UnrealFileServer, UnrealLightMass, UnrealCEFSubProcess, UnrealPak, BootstrapPackagedGame, UnrealHeaderTool, BuildPatchTool, CrashReportClient, SlateViewer, SymbolDebugger, UnrealVersionSelector, UnrealWatchdog, UnrealFrontend, BlankProgram, ShaderCacheTool, UnrealVersionSelector, MiniDumpDiagnostics,

A .sln generated by creating a new C++ project from the UE4Editor UI does not appear to have this issue. Likewise I am able to build the project itself either by building it exclusively in Visual Studio, building manually using Build.bat or by omitting the ‘-Engine’ flag from the GenerateProjectFiles.bat command

Command used to generate project project files:

[Path-To-Engine]/Build/BatchFiles/GenerateProjectFiles.bat [Path-To-Project]/MyProject.uproject -Game -Engine -2015

This seems to have started occurring since upgrading to 4.18.3. I am using the same process to generate project files that I have for previous versions of the engine/project. Please let me know if I am doing something wrong here.

Thank You

Hi Clayton! Did you figure out what was happening?

This issue is triggered by running multiple build processes. Visual Studio 2017 number of build threads can be set from:
Tools → Options → Projects and Solutions → Build and Run → maximum number of parallel project builds

Setting it to 1 allowed my solution to build correctly. I would suggest setting the number of build processes back to default (8 in my case) after building the engine since it could have significant impact on Visual Studio performance.

Worked for me! (same trouble with UE 4.18 from git) It’s kind of a bummer since I’m seating on a 12 core CPU… The good news is although projects won’t run in parallel the .obj are still processed simultaneously, I’m using 100% cores except on linking phase.