How to Resolve error CS0246: The type or namespace name 'Target' could not be found (are you missing a using directive or an assembly reference?)

can anyone pls tell how to resolve this error “CS0246: The type or namespace name ‘Target’ could not be found (are you missing a using directive or an assembly reference?)” as its showing same after UE4 Editor’s code’s Compilation.

Output_Debug


1 Like

Here is an example target file from one of my projects. Notice it’s inheriting from TargetRules and not Target

edit: Swapped out code for a UE4 version so it’s more consistent.

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class DeltaEditorTarget : TargetRules
{
	public DeltaEditorTarget( TargetInfo Target) : base(Target)
	{
		Type = TargetType.Editor;
		DefaultBuildSettings = BuildSettingsVersion.V2;
		ExtraModuleNames.AddRange( new string[] { "Delta" } );
	}
}

Was there a solution? Having same issue now.