x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Failed to generate Visual Studio project files 4.20

When I try to generate the Visual Studio project files for my project, wich I did before successfully, it now throws this error:

Running E:/Epic Games/UE_4.20/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="...Project.uproject" -game -rocket -progress -log=...Project/Saved/Logs/UnrealVersionSelector-2018.10.22-12.14.15.log Discovering modules, targets and source code for project... ERROR: UnrealBuildTool Exception: Unable to instantiate instance of '...ProjectTarget' object type from compiled assembly '...ProjectModuleRules'. Unreal Build Tool creates an instance of your module's 'Rules' object in order to find out about your module's requirements. The CLR exception details may provide more information: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object. at UnrealBuildTool.TargetRules..ctor(TargetInfo Target) in D:\Build++UE4\Sync\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Configuration\TargetRules.cs:line 1240 at ...ProjectTarget..ctor(TargetInfo Target) in ...Project\Source...Project.Target.cs:line 8 --- End of inner exception stack trace --- at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) at System.Reflection.RuntimeConstructorInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) at UnrealBuildTool.RulesAssembly.CreateTargetRulesInstance(String TypeName, TargetInfo TargetInfo) in D:\Build++UE4\Sync\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\System\RulesAssembly.cs:line 425

Can anyone help me on how to fix this problem?

I already reinstalled VS 2017 and 4.20, nothing worked.

Product Version: UE 4.20
Tags:
more ▼

asked Oct 22 '18 at 10:24 AM in C++ Programming

avatar image

Qygon
6 1 4

avatar image TheDreamCatcher Oct 22 '18 at 10:27 AM

what is the content of your Build.cs

avatar image Qygon Oct 22 '18 at 10:29 AM
 using UnrealBuildTool;
 
 public class CrowdProject : ModuleRules
 {
     public CrowdProject(ReadOnlyTargetRules Target) : base(Target)
     {
         PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
     
         PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
 
         PrivateDependencyModuleNames.AddRange(new string[] {  });
 
         // Uncomment if you are using Slate UI
         // PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
         
         // Uncomment if you are using online features
         // PrivateDependencyModuleNames.Add("OnlineSubsystem");
 
         // To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
     }
 }
 
avatar image TheDreamCatcher Oct 22 '18 at 10:30 AM

and the Target.cs?

avatar image Qygon Oct 22 '18 at 10:31 AM
 using UnrealBuildTool;
 using System.Collections.Generic;
 
 public class CrowdProjectTarget : TargetRules
 {
     public CrowdProjectTarget(TargetInfo Target) : base(Target)
     {
         Type = TargetType.Game;
 
         ExtraModuleNames.AddRange( new string[] { "CrowdProject" } );
     }
 }
 
avatar image TheDreamCatcher Oct 22 '18 at 10:36 AM

you are trying to generate the project files from the editor or the context menu?

avatar image Qygon Oct 22 '18 at 10:37 AM

Context menu

avatar image TheDreamCatcher Oct 22 '18 at 10:40 AM

try to use the command line: "E:\Epic Games\UE_4.20\Engine\Binaries\DotNet\UnrealBuildTool.exe" -projectFiles -project="DRIVE:\Path\To\Project\CrowdProject\CrowdProject.uproject" -game -engine -progress -2017

avatar image Qygon Oct 22 '18 at 10:47 AM

I get the same Error as before

avatar image TheDreamCatcher Oct 22 '18 at 10:51 AM

try removing -progress from the command line

avatar image Qygon Oct 22 '18 at 10:55 AM

Same error.

But I managed to narrow it down a little bit, if I copy my Config folder in a new project, the same thing happens

avatar image TheDreamCatcher Oct 22 '18 at 10:56 AM

well you can try to create a new project and copy the config folder from th new to the old project and see if it fixes things.

avatar image Qygon Oct 22 '18 at 10:59 AM

I'm gonna copy every config file separately to see wich one it is and then look at the content... I think I'll manage from here, if I need anymore help I'll make another comment.

But thanks for the help anyways

avatar image TheDreamCatcher Oct 22 '18 at 11:01 AM

if that doesn't work you can try to delete the Intermediate and Binaries folders

avatar image Qygon Oct 22 '18 at 11:10 AM

Nah, I found it. Thanks again dude :)

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Ok I found the problem, apparently someone in my team added the newly added Crypto system to our Project, wich lead to me not being able to generate the VS project files or compile with VS in any way. So if you have Crypto enabled in your Project and you run into a similar or probably any problem, first try disabling it.

more ▼

answered Oct 22 '18 at 11:09 AM

avatar image

Qygon
6 1 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question