Problem with ProjectName.Target.cs

I can’t open my project, if I try to do this a window alert me that there is a problem with UE4Editor-ProjectName.dll

I’ve tried to start with “generate visual studio…” but nothing is changed, a message says:

Running C:/Program Files/Epic Games/4.9/Engine/Binaries/DotNET/UnrealBuildTool.exe  -projectfiles -project="[Mydirectory]/Unreal Projects/[Project Name]/[ProjectName].uproject" -game -rocket -progress
Discovering modules, targets and source code for game...
Errors detected while compiling [Mydirectory\Unreal Projects\ProjectName\Intermediate\Build\BuildRules\RocketUE4ModuleRules.dll:
[My Directory]\Unreal Projects\[ProjectName]\Intermediate\Source\[ProjectName].Target.cs(**6,14**) : error CS0101: The Namespace already contains a definition for '[ProjectName]Target'.
UnrealBuildTool Exception: ERROR: UnrealBuildTool encountered an error while compiling source files

on "incriminated" file:

using UnrealBuildTool;
using System.Collections.Generic;

public class [ProjectName]Target : TargetRules
{
    public [ProjectName]Target(TargetInfo Target)
	{
		Type = TargetType.Game;
	}

I’ve tried to:

  • Downgrade from 4.10 to 4.9
  • Reinstall Visual Studio
  • Change engine version

Hey eniac-

Can you elaborate on what you’re seeing? Which engine version is the project using? What were you working on prior to this error (such as adding / editing code)? Was the code listed in your post part of the error message? Can you Identify where in the project this code exists?

Cheers

Doug WIlson

Hi Doug

I’m working with UE4.10.1 using only blueprints, no c++

Before the error: I was working with localization’s tool (with no results) This error is apperas when i’ve tried to open the project from the launcher.

The problematic file seems: /intermediate/source/projectname.target

using UnrealBuildTool;
using System.Collections.Generic;

public class [ProjectName]Target : TargetRules
{
public [ProjectName]Target(TargetInfo Target)
{
Type = TargetType.Game;
}

If the project you’re working with is purely blueprints can you explain where the code in the first post is coming from? You mention trying to downgrade from 4.10 to 4.9, did this problem first start right after upgrading to 4.10? If possible could you send me a copy of the project that isn’t opening? If you’re able to upload it somewhere like Dropbox you can post the download link here or send me a PM on the forums with the download link for privacy.

Following the localization tutorial, i’ve created a new class C++, only for follwing the tutorial because that function for me was unknowed untill that moment. I Think is this the cause to all problems.
Unfortunately i can’t send material of project, anyway thanks for your proposal: download a project, check it and send a solution to me, I know, require time. Thanks for your offer but, unfortunately i can’t :confused:

Can you provide a link to the localization tutorial you were following and point out at what point in the tutorial you ran into this issue? This will help me reproduce the problem locally for more information.

Hey eniac-

We’ve not heard from you in a few days and will be closing this post for tracking purposes. If you are still experiencing issues using localization fell free to respond with a comment to reopen the post.

Cheers

Doug Wilson

Hi Doug, sorry i’ve missed the reply. Anyway I’ve fixed it.
I’ve created a new project and I moved the content folder inside it, a little bit of work but now it works. The problem, i think, was a overwriting by visual basic.

Thanks for your help!