Generate Visual Studio project files unable to compile

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

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?

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.

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

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

It work, thanks a lot

useful, thanks!