# Trouble generating new VS project files from uproject

**URL:** <https://forums.unrealengine.com/t/trouble-generating-new-vs-project-files-from-uproject/338031>\
**Category:** C++\
**Tags:** compiling, unreal-engine, setup, question, CPP\
**Created:** [November 10, 2015, 2:37pm UTC](https://forums.unrealengine.com/t/trouble-generating-new-vs-project-files-from-uproject/338031 "2015-11-10T14:37:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_82b88924](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_82b88924](https://forums.unrealengine.com/u/anonymous_user_82b88924)\
**Post date:** [November 10, 2015, 2:37pm UTC](https://forums.unrealengine.com/t/trouble-generating-new-vs-project-files-from-uproject/338031/1 "2015-11-10T14:37:11Z")

</div>

I’m sure this is a basic error, but I can’t find any information about it. Every time I try to generate visual studio project files from my uproject I get the following error:

`Running path/UnrealBuildTool.exe -projectfiles -project="MyActualProject_Path/MyActualProject.uproject" -game -rocket -progress`

`Discovering modules, targets and source code for game...`

`UnrealBuildTool Exception: ERROR: Not expecting project Intermediate\ProjectFiles\MyActualProject.vcxproj to already have a target rules of with configuration name Game (SomePluginProjectTarget) while trying to add: MyActualProjectTarget`

I only just noticed this when trying to setup a new workspace. I went back and tried to generate new project files from my established workspaces, and they ALSO threw this error.

Any pointers? Thanks in advance.

* * *

Update  
I’ve created a new project to test with, and generating visual studio project files works, no problems. I’ve also tested on other projects that I’ve been using for the last little while and they also work.  
**I guess the question is, where do target rules come from, and how can I set this up to work properly?**

---

<div class="post-metadata">

**Author:** ![Joe\_Conley](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Joe\_Conley](https://forums.unrealengine.com/u/Joe_Conley)\
**Post date:** [November 11, 2015, 9:07am UTC](https://forums.unrealengine.com/t/trouble-generating-new-vs-project-files-from-uproject/338031/2 "2015-11-11T09:07:41Z")

</div>

I would first try deleting the contents of \Intermediate\ProjectFiles\ and starting fresh, if you haven’t tried that. You can delete all of the contents of \Intermediate\ProjectFiles, and they will be rebuilt the next time you run GenerateProjectFiles.bat, and that may solve the issue. That or it might be that you have the the same target configuration defined in two places.

There should only be a Target.cs file in your project folder, not in any plugin folders.

It looks like someone had the same problem here before:

[Adding Custom Module to UE4 Project](https://answers.unrealengine.com/questions/119417/adding-custom-module-to-ue4-project.html)

Hope that helps!

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_82b88924](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_82b88924](https://forums.unrealengine.com/u/anonymous_user_82b88924)\
**Post date:** [November 11, 2015, 3:01pm UTC](https://forums.unrealengine.com/t/trouble-generating-new-vs-project-files-from-uproject/338031/3 "2015-11-11T15:01:39Z")

</div>

Ah, I see. When the plugin was added for whatever reason the PluginProject had it’s .target.cs files checked into the source folder, along with the rest of it’s source code. Removing the PluginProject.target.cs files from the source folder lets me build my visual studio project files again. To actually add the Plugin as a dependency, I changed the line:  
`PrivateDependencyModuleNames.AddRange(new string[] { });`  
to  
`PrivateDependencyModuleNames.AddRange(new string[] { "OceanProject" });`  
Is that how I’m supposed to have done that? There’s nothing else that needs to be added to the solution explorer or anything?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [November 11, 2015, 4:13pm UTC](https://forums.unrealengine.com/t/trouble-generating-new-vs-project-files-from-uproject/338031/4 "2015-11-11T16:13:08Z")

</div>

That is correct. Just keep in mind that adding the plugin as a dependency means that it will be required to be present in order to build the project.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_82b88924](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_82b88924](https://forums.unrealengine.com/u/anonymous_user_82b88924)\
**Post date:** [November 12, 2015, 12:10pm UTC](https://forums.unrealengine.com/t/trouble-generating-new-vs-project-files-from-uproject/338031/5 "2015-11-12T12:10:08Z")

</div>

Great! Thanks both Joe and .

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_71046e02](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_71046e02](https://forums.unrealengine.com/u/anonymous_user_71046e02)\
**Post date:** [August 1, 2016, 3:44am UTC](https://forums.unrealengine.com/t/trouble-generating-new-vs-project-files-from-uproject/338031/6 "2016-08-01T03:44:23Z")

</div>

I downloaded a plugin named VaRest from market place.  
In my project ,I enabled this plugin.When I try to pakage it,it shows some errors as following.  
mono: UnrealBuildTool Exception: ERROR: Not expecting project /Users//Documents/Unreal Projects/UE402/Intermediate/ProjectFilesIOS/UE4.xcodeproj to already have a target rules of with configuration name Game (UE4GameTarget) while trying to add: UE4Target

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_b666e59e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_b666e59e](https://forums.unrealengine.com/u/anonymous_user_b666e59e)\
**Post date:** [August 5, 2016, 5:25pm UTC](https://forums.unrealengine.com/t/trouble-generating-new-vs-project-files-from-uproject/338031/7 "2016-08-05T17:25:23Z")

</div>

Hi mayaping,

Does this only happen when packaging? Does it also occur in a new test project?
