Couldn't find target rules file for target 'UE4Server' in rules assembly 'UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'

I am trying to get a dedicated server built with ue4 4.20. However whenever I try and build the server in visual studio I get the error

Severity	Code	Description	Project	File	Line	Suppression State
Error		

    Couldn't find target rules file for target 'UE4Server' in rules assembly 'UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.	MMOgame	C:\Users\akrol\Desktop\MainBuild\MMOgame\Intermediate\ProjectFiles\UnrealBuildTool	1	

I have a server target though and here is what is in it

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

using UnrealBuildTool;
using System.Collections.Generic;

    [SupportedPlatforms(UnrealPlatformClass.Server)]
    public class MMOgameServerTarget : TargetRules   // Change this line as shown previously
    {
           public MMOgameServerTarget(TargetInfo Target) : base(Target)  // Change this line as shown previously
           {
            Type = TargetType.Server;
            ExtraModuleNames.Add("MMOgame");    // Change this line as shown previously
           }
    }

Does anyone know how to fix this by chance I have looked around but haven’t found any solutions that helped :confused:

I fallowed this tutorial A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums

Thank you for your time.

Try to delete the Intermediate & Saved folder will help.

I tried deleting those then re generating the visual studio project files and still get the error :confused:

I noticed these though when i was generating the files however it still goes through

Discovering modules, targets and source code for project…
C:\Program Files\Epic Games\UE_4.20\Engine\Source\ThirdParty\Expat\Expat.Build.cs: warning: Referenced directory ‘C:\Program Files\Epic Games\UE_4.20\Engine\Source\ThirdParty\Expat\expat-2.2.0\Win64\VS2015\Release’ does not exist.
C:\Program Files\Epic Games\UE_4.20\Engine\Plugins\Marketplace\SocketIOClient\Source\SocketIOClient\SocketIOClient.Build.cs: warning: Referenced directory ‘C:\Program Files\Epic Games\UE_4.20\Engine\Source\SocketIOClient\Public’ does not exist.
C:\Program Files\Epic Games\UE_4.20\Engine\Plugins\Marketplace\SocketIOClient\Source\SocketIOClient\SocketIOClient.Build.cs: warning: Referenced directory ‘C:\Program Files\Epic Games\UE_4.20\Engine\Plugins\Marketplace\SocketIOClient\Source\ThirdParty\Boost\Include’ does not exist.
C:\Program Files\Epic Games\UE_4.20\Engine\Plugins\Marketplace\SocketIOClient\Source\CoreUtility\CoreUtility.Build.cs: warning: Referenced directory ‘C:\Program Files\Epic Games\UE_4.20\Engine\Source\CoreUtility\Public’ does not exist.

Did you find solution for your problem?

rolle817, I got this issus too, have you found any clue?