# Project files won't generate after adding Unreal Dedicated Server template (server.target)

**URL:** <https://forums.unrealengine.com/t/project-files-wont-generate-after-adding-unreal-dedicated-server-template-server-target/72451>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [August 30, 2016, 12:10am UTC](https://forums.unrealengine.com/t/project-files-wont-generate-after-adding-unreal-dedicated-server-template-server-target/72451 "2016-08-30T00:10:05Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allenheathx](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Allenheathx](https://forums.unrealengine.com/u/Allenheathx)\
**Post date:** [August 30, 2016, 12:10am UTC](https://forums.unrealengine.com/t/project-files-wont-generate-after-adding-unreal-dedicated-server-template-server-target/72451/1 "2016-08-30T00:10:05Z")

</div>

I am trying to create the server files for a packaged game that includes access to a dedicated server. I am using this guide: [A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums](https://wiki.unrealengine.com/Dedicated_Server_Guide_%28Windows_%26_Linux%29) and this template: [A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums](https://wiki.unrealengine.com/Standalone_Dedicated_Server)

I am stuck at section 5. Particularly this: “At this point you need to refresh your Visual Studio project using the editor. This is a critical step to get the Visual Studio project from recognizing the new Server Target file.”

I can not get the server.target file to Generate after I have added it into the project source folder.

-Generate Visual Studio Project Files gives me the following error:

UnrealBuildTool Exception: ERROR: Expecting to find a type to be declared in a target rules named ‘Liftedline\_1ServerTarget’. This type must derive from the ‘TargetRules’ type defined by Unreal Build Tool.

(Another guy had a similar problem [https://answers.unrealengine.com/questions/233276/error-when-trying-to-compile-dedicated-server-bina.html](https://answers.unrealengine.com/questions/233276/error-when-trying-to-compile-dedicated-server-bina.html) , I have tried those templates but the error persists and still can’t get VS to see those either. I have tried both with and without the extra build.target the guy in the post mentions).

-Re-builds, scans and solution explorer refresh don’t make VS recognize server.target file.

Any help would be greatly appreciated.

Note\* My project file is on a different drive then my github compiled version of UE4. Server.target file is placed in Project File—\>source

Thanks

 ![server.target_error.png](https://d3kjluh73b9h9o.cloudfront.net/original/3X/9/5/95574b29228b35fd56fa2281e824c4c9217f51d4.png)

---

<div class="post-metadata">

**Author:** ![UnrealEverything](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@UnrealEverything](https://forums.unrealengine.com/u/UnrealEverything)\
**Post date:** [August 30, 2016, 7:06am UTC](https://forums.unrealengine.com/t/project-files-wont-generate-after-adding-unreal-dedicated-server-template-server-target/72451/2 "2016-08-30T07:06:58Z")

</div>

The name of the public class in the \<Projectname\>Server.Target.cs file is expected to be \<Projectname\>ServerTarget and must derive from TargetRules. In your case the class is name GameServerTarget, therefore the UnrealBuildTool complains. Just change the name of the class (don’t forget to adjust the constructor accordingly) and you should be good to go. So in your case the class should be named Liftedline\_1ServerTarget.

---

<div class="post-metadata">

**Author:** ![RDelvax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDelvax](https://forums.unrealengine.com/u/RDelvax)\
**Post date:** [August 9, 2018, 7:20pm UTC](https://forums.unrealengine.com/t/project-files-wont-generate-after-adding-unreal-dedicated-server-template-server-target/72451/3 "2018-08-09T19:20:12Z")

</div>

I get the same error:  
Running E:/UnrealEngine-4.19/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project=“E:/Witches\_and\_Angels/Witches\_and\_Angels.uproject” -game -engine -progress  
Discovering modules, targets and source code for project…  
ERROR: UnrealBuildTool Exception: Expecting to find a type to be declared in a target rules named ‘Witches\_And\_AngelsServerTarget’. This type must derive from the ‘TargetRules’ type defined by Unreal Build Tool.

The content of my target file:

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;  
using System.Collections.Generic;

[SupportedPlatforms(UnrealPlatformClass.Server)]  
public class Witches\_and\_AngelsServerTarget : TargetRules // Change this line as shown previously  
{  
public Witches\_and\_AngelsServerTarget(TargetInfo Target) : base(Target) // Change this line as shown previously  
{  
Type = TargetType.Server;  
ExtraModuleNames.Add(“Witches\_and\_Angels”); // Change this line as shown previously  
}  
}

I built the engine from source without errors, started my built engine and made a new project. Generating visual studio files wasn’t a problem either.  
Then I added the server.tartet.cs file (Witches\_and\_AngelsServer.Target.cs) , richt clicked on the project file, selected change version and clicked OK without changing anything.  
That’s when I got the error above.

I got the same error with a project created with original version 4.20, then changed to either built 4.20 or built 4.19, even built the engines in different drives so engine and project are on the same drive.  
When I leave out the server target file I don’t get any errors. (obviously, as the error states it’s from the server target file).

I used the content of a posted server target file for 4.18, since it doesn’t seem to be the same as 4.17. (assuming 4.19 and 4.20 would be the same too)

What do I have to do to make this work?

(visual studio 2017 comunity, windows SDK 8,1 and 10, running windows 10 home 64bit)

\*\*\* I used following tutorials with the same results…:  
\*\*\* [Unreal Engine 4 Good to Know - Making A Dedicated Server - YouTube](https://www.youtube.com/watch?v=94liD8Sfs8I)  
\*\*\* [https://wiki.unrealengine.com/Dedica…dows\_%26\_Linux](https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux))

When I actually try to build the project, the development editor builds without problems, but the development server gives the following 3 errors:

Error MSB3075 The command “E:\UnrealEngine-4.19\Engine\Build\BatchFiles\Build.bat Witches\_and\_Angels Win64 Development “E:\Witches\_and\_Angels\Witches\_and\_Angels.uproject” -WaitMutex -FromMsBuild” exited with code 5. Please verify that you have sufficient rights to run this command. Witches\_and\_Angels D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets 44  
Error C4577 ‘noexcept’ used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc Witches\_and\_Angels D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.14.26428\INCLUDE\vcruntime\_new.h 67  
Error UBT ERROR: Failed to produce item: E:\UnrealEngine-4.19\Engine\Plugins\Media\WmfMedia\Binaries\Win64\Witches\_and\_Angels-WmfMedia.lib Witches\_and\_Angels E:\Witches\_and\_Angels\Intermediate\ProjectFiles\UnrealBuildTool 1

When I run visual studio as administrator, the first error is resolved, but the following error occurs instead:

Error MSB3073 The command “E:\UnrealEngine-4.19\Engine\Build\BatchFiles\Rebuild.bat Witches\_and\_Angels Win64 Development “E:\Witches\_and\_Angels\Witches\_and\_Angels.uproject” -WaitMutex -FromMsBuild” exited with code -1. Witches\_and\_Angels D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets 49

---

<div class="post-metadata">

**Author:** ![RDelvax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDelvax](https://forums.unrealengine.com/u/RDelvax)\
**Post date:** [August 9, 2018, 11:43pm UTC](https://forums.unrealengine.com/t/project-files-wont-generate-after-adding-unreal-dedicated-server-template-server-target/72451/4 "2018-08-09T23:43:30Z")

</div>

When I use this code for the server target:

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool; using System.Collections.Generic;

public class Witches\_and\_AngelsServerTarget : TargetRules {

public Witches\_and\_AngelsServerTarget(TargetInfo Target)  
{  
Type = TargetType.Server;  
}

//  
// TargetRules interface.  
//  
public override void SetupBinaries(  
TargetInfo Target,  
ref List\<UEBuildBinaryConfiguration\> OutBuildBinaryConfigurations,  
ref List\<string\> OutExtraModuleNames  
)  
{  
base.SetupBinaries(Target, ref OutBuildBinaryConfigurations, ref OutExtraModuleNames);  
OutExtraModuleNames.Add(“Witches\_and\_Angels”);  
}

public override bool GetSupportedPlatforms(ref List\<UnrealTargetPlatform\> OutPlatforms)  
{  
// It is valid for only server platforms  
return UnrealBuildTool.UnrealBuildTool.GetAllServerPlatforms(ref OutPlatforms, false);  
}

public override List\<UnrealTargetPlatform\> GUBP\_GetPlatforms\_MonolithicOnly(UnrealTargetPlatform HostPlatform)  
{  
if (HostPlatform == UnrealTargetPlatform.Mac)  
{  
return new List\<UnrealTargetPlatform\>();  
}  
return new List\<UnrealTargetPlatform\> { HostPlatform, UnrealTargetPlatform.Win32, UnrealTargetPlatform.Linux };  
}

public override List\<UnrealTargetConfiguration\> GUBP\_GetConfigs\_MonolithicOnly(UnrealTargetPlatform HostPlatform, UnrealTargetPlatform Platform)  
{  
return new List\<UnrealTargetConfiguration\> { UnrealTargetConfiguration.Development };  
}

}

I get the following error messages:

ERROR: e:\Witches\_and\_Angels\Source\Witches\_and\_AngelsServer.Target.cs(17,17) : error CS0122: ‘UnrealBuildTool.UEBuildBinaryConfiguration’ is inaccessible due to its protection level  
ERROR: e:\Witches\_and\_Angels\Source\Witches\_and\_AngelsServer.Target.cs(15,25) : error CS0051: Inconsistent accessibility: parameter type ‘ref System.Collections.Generic.List\<UnrealBuildTool.UEBuildBinaryConfiguration\>’ is less accessible than method ‘Witches\_and\_AngelsServerTarget.SetupBinaries(UnrealBuildTool.TargetInfo, ref System.Collections.Generic.List\<UnrealBuildTool.UEBuildBinaryConfiguration\>, ref System.Collections.Generic.List\<string\>)’  
ERROR: UnrealBuildTool Exception: Unable to compile source files.

---

<div class="post-metadata">

**Author:** ![RDelvax](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RDelvax](https://forums.unrealengine.com/u/RDelvax)\
**Post date:** [August 10, 2018, 12:27am UTC](https://forums.unrealengine.com/t/project-files-wont-generate-after-adding-unreal-dedicated-server-template-server-target/72451/5 "2018-08-10T00:27:24Z")

</div>

Following these instructions:

```
          https://answers.unrealengine.com/questions/718575/error-when-updating-to-418-generating-visual-studi.html

```

I actually didn’t get any errors, and was able to build the server without errors.  
That does mean however that I almost completely stripped the server target file clean.

This is all that’s left:

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool; using System.Collections.Generic;

public class Witches\_and\_AngelsServerTarget : TargetRules {

public Witches\_and\_AngelsServerTarget(TargetInfo Target) : base (Target)  
{  
Type = TargetType.Server;  
ExtraModuleNames.Add(“Witches\_and\_Angels”);  
}  
}

Is that right? Or will this give me problems later on?

---

<div class="post-metadata">

**Author:** ![grsthrt](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@grsthrt](https://forums.unrealengine.com/u/grsthrt)\
**Post date:** [July 15, 2022, 8:37am UTC](https://forums.unrealengine.com/t/project-files-wont-generate-after-adding-unreal-dedicated-server-template-server-target/72451/6 "2022-07-15T08:37:51Z")

</div>

Just install dotnet

---

<div class="post-metadata">

**Author:** ![ShockforceTX](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ShockforceTX](https://forums.unrealengine.com/u/ShockforceTX)\
**Post date:** [September 13, 2023, 4:46pm UTC](https://forums.unrealengine.com/t/project-files-wont-generate-after-adding-unreal-dedicated-server-template-server-target/72451/7 "2023-09-13T16:46:32Z")

</div>

Still relevant in 5.2 2023. Fixed my issue in 2 seconds. Thanks.
