Can't generate C++ projects since 4.12.5

I posted this already, but I am not seeing it anywhere on the forums, so reposting.

Can not generate C++ projects nor can I “generate visual studio project files” from the right-click context. On ANY project, I will always get:

Running C:/Program Files/Epic Games/4.12/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“G:/repos/VSTTestUnreal/VSTTestUnreal.uproject” -game -rocket -progress
Discovering modules, targets and source code for project…
UnrealBuildTool Exception: ERROR: Not expecting project G:\repos\VSTTestUnreal\Intermediate\ProjectFiles\UE4.vcxproj to already have a target rules of with configuration name Game (UE4GameTarget) while trying to add: VSTTestUnrealTarget

Have read extensively all posts relating to this issue. Have not found any solution that works. This error is new since upgrading today. I have re-verifyied. Same error. Rebooted. Same. And note that I will get this even if I create a project from scratch using the Launcher…when I try to add a C++ class, I will get this error from within the editor.

Am dead in the water, appreciate some guidance.

This is just a shot in the dark, but did you try deleting G:\repos\VSTTestUnreal\Intermediate\ProjectFiles\UE4.vcxproj?

yes, that was the first thing to try…but this happens with ANY project…not just the one I show above. Even projects that are just being created net-new via the Launcher…even the launcher can’t create a C++ project and will fail with this error. So something fundamental is broken here.

Unfortunately I have no idea then. Hopefully you’ll manage to get someone from Epic to look at this.

Hi gbrill,

Sorry for the delay. A couple quick questions to get started. Does the error you receive when creating a new project also reference VSTTestUnrealTarget? If so, what is VSTTestUnreal?

This error will occur an ANY project of any kind of name. I just happened to print the error from VSTUnreal, but any .uproject will generate the same issue.

For example, if I create a brand new project called “Foo” using epic launcher, I get immediately when it compiles initially:

UnrealBuildTool Exception: ERROR: Not expecting project Foo.vcxproj to already have a target rules of with configuration name Game (UE4GameTarget) while trying to add: FooTarget

That is what is alarming about the error, it is true for any C++ project.

Would it be possible to just describe, really briefly, what the build tool is trying to do here? What is a UE4GameTarget? Is it a kind of base from which my target must be derived? I feel like if I understood this a little better, I could get to the bottom of the issue right away.

Hi gbrill,

I did some checking on this issue, and it seems like a few people have come across this particular error before. In previous instances, it was a case where multiple Target files were trying to define the same target type (Game, in this instance). Since this is happening with multiple projects, including new ones, have you added any new plugins to the Engine recently? Would it be possible to get a zipped copy of one of the new projects that you created that was having this issue?

Hi gbrill,

We have not heard back from you for a while. Are you still having trouble with this issue? I will be marking this post as resolved for internal tracking purposes. If you still need any help with this, please feel free to add a comment to the post at any time to open it again.

I had this issue after copying the project for different engine versions, as I was testing build with various versions of Unreal. Because I was still testing I didn’t delete the original project and kept all the versions instead, causing the project folder to contain to be filled with MyGame, MyGame 4.20, MyGame 4.21, etc. but all containing the same MyGame/Source/MyGame.Target.cs with the same module name "MyGame" of type TargetType.Game.

GenerateProjectFiles.bat would always end with the “already have a target rules” error.

Deleting the project variants (or moving them elsewhere as backup) fixed the issue.

Note: I was working on a C++ project containing the Engine itself in the same root folder as all the project variants.