# Generate Visual Studio project files unable to compile

**URL:** <https://forums.unrealengine.com/t/generate-visual-studio-project-files-unable-to-compile/417146>\
**Category:** Blueprint\
**Tags:** unreal-engine, generate-project-fil, Visual-Studio, Blueprint, question, CPP\
**Created:** [February 13, 2018, 12:31am UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-unable-to-compile/417146 "2018-02-13T00:31:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dscottwilson](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dscottwilson](https://forums.unrealengine.com/u/dscottwilson)\
**Post date:** [February 13, 2018, 12:31am UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-unable-to-compile/417146/1 "2018-02-13T00:31:16Z")

</div>

I’m trying to generate C++ files for my currently Blueprint project to ultimately create a dedicated server.

Whenever I try to create a C++ class file in my project, it comes up with this although, I don’t have a compile button in UE as its a Blueprints project.

[https://puu.sh/zmtJd/592e98aaf6.png](https://puu.sh/zmtJd/592e98aaf6.png)

After getting this error, I have tried to then right click the .uproject file and click “Generate Visual Studio project files” but that process fails and comes up with this error.

```
Running F:/Program Files/Epic Games/UE_4.18/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="H:/Games design/UE4 Projects/WeaponEngine Active/WeaponEngine 4.18/WeaponEngine.uproject" -game -rocket -progress
Discovering modules, targets and source code for project...
While compiling H:\Games design\UE4 Projects\WeaponEngine Active\WeaponEngine 4.18\Intermediate\Build\BuildRules\WeaponEngineModuleRules.dll:
ERROR: h:\Games design\UE4 Projects\WeaponEngine Active\WeaponEngine 4.18\Intermediate\Source\WeaponEngine.Target.cs(6,14) : error CS0101: The namespace '<global namespace>' already contains a definition for 'WeaponEngineTarget'
ERROR: UnrealBuildTool Exception: Unable to compile source files.

```

Any tips?

---

<div class="post-metadata">

**Author:** ![Takao\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Takao\_1](https://forums.unrealengine.com/u/Takao_1)\
**Post date:** [February 13, 2018, 1:27pm UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-unable-to-compile/417146/2 "2018-02-13T13:27:37Z")

</div>

Delete the following temporary folders: Binaries, build, intermediate and saved. Delete the visual studio project file, if existing.

Open the unreal project file. Afterwards right klick on the project file and create the visual studio project file.

---

<div class="post-metadata">

**Author:** ![dscottwilson](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@dscottwilson](https://forums.unrealengine.com/u/dscottwilson)\
**Post date:** [February 13, 2018, 1:51pm UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-unable-to-compile/417146/3 "2018-02-13T13:51:15Z")

</div>

It worked. I deleted Binaries, Build and Intermediate which then allowed me to add a C++ class successfully.

---

<div class="post-metadata">

**Author:** ![Lobotomiac](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lobotomiac](https://forums.unrealengine.com/u/Lobotomiac)\
**Post date:** [December 11, 2018, 6:48pm UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-unable-to-compile/417146/4 "2018-12-11T18:48:45Z")

</div>

Hey there. I had a similar error when trying to Generate VS files, but only in case if I deleted the Saved folder. I failed to find any reason for this and if perhaps anyone here could share info on why that is that would be awesome. Thanks

---

<div class="post-metadata">

**Author:** ![Why\_Qiliao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Why\_Qiliao](https://forums.unrealengine.com/u/Why_Qiliao)\
**Post date:** [August 10, 2019, 8:50am UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-unable-to-compile/417146/5 "2019-08-10T08:50:50Z")

</div>

It work, thanks a lot

---

<div class="post-metadata">

**Author:** ![Tiax615](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Tiax615](https://forums.unrealengine.com/u/Tiax615)\
**Post date:** [August 29, 2019, 6:51am UTC](https://forums.unrealengine.com/t/generate-visual-studio-project-files-unable-to-compile/417146/6 "2019-08-29T06:51:57Z")

</div>

useful, thanks!
