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 project files, System.ArgumentOutOfRangeException

I get this error when I tried to create any c++ project:

Failed to generate project files. Log output: Running C:/Program Files/Epic Games/4.7/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="C:/Users/Van/Documents/Unreal Projects/Fly/Fly.uproject" -game -rocket -progress Discovering modules, targets and source code for game... UnrealBuildTool Exception: System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length at System.String.Substring(Int32 startIndex, Int32 length) at UnrealBuildTool.Utils.SetEnvironmentVariablesFromBatchFile(String BatchFileName) at UnrealBuildTool.VCEnvironment..ctor(CPPTargetPlatform InPlatform) at UnrealBuildTool.VCToolChain.GetVCIncludePaths(CPPTargetPlatform Platform) at UnrealBuildTool.VCProjectFile.WriteProjectFile(List`1 InPlatforms, List`1 InConfigurations) at UnrealBuildTool.ProjectFileGenerator.WriteProjectFiles() at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(String[] Arguments, Boolean& bSuccess) at UnrealBuildTool.UnrealBuildTool.GenerateProjectFiles(ProjectFileGenerator Generator, String[] Arguments) at UnrealBuildTool.UnrealBuildTool.Main(String[] Arguments)

Been trying to find a solution for months now. Still nothing. Win 7 64bit, VS 2013 Ultimate

If the arguments are: -projectfiles -project="C:/Users/Van/Documents/Unreal Projects/Fly/Fly.uproject" -game -rocket -progress, How can that length be less than zero?

Product Version: Not Selected
more ▼

asked Feb 25 '15 at 03:02 AM in Installation & Setup

avatar image

74 20 21 24

avatar image Doug E ♦♦ STAFF Feb 27 '15 at 08:31 PM

Hey Snipe3000-

Just to make sure I understand what's happening on your end I want to clarify that you receive this error when you create a code based project, correct? Are you using a source build of the engine from GitHub or are you using the Launcher? If you are using the Launcher you can click the drop down arrow for your engine version and select Verify. If you are still having problems let us know along with any additional information about how you're setting up the project and exactly when this error occurs.


Doug Wilson

avatar image Snipe3000 Feb 28 '15 at 03:18 AM

Yes, this happens when I create a C++ based project, Blueprint projects seem to work just fine. I am using the Launcher version of unreal engine. I have the latest version, 4.7.1. I ran verify, but I'm still getting the same error. As soon as I click 'Create Project', with Desktop/Console, Maximum Quality, and With Starter Content selected; The creating project progress bar gets to 90%, then I get the error message I posted above.

This is very confusing. I have the exact same version of VS on my Windows8 laptop and the unreal engine doesn't have this issue. I'm not sure whats causing it.

avatar image Doug E ♦♦ STAFF Mar 02 '15 at 09:11 PM

Does the same crash occur if you use another version of the engine from the Launcher? If so then there may be an issue with the version of Visual Studio on your computer and may need to re install it. If another engine version does not crash then it may help to uninstall 4.7.1 and then re-download it. Let me know if either of these options help.

avatar image Snipe3000 Mar 02 '15 at 11:58 PM

Yes, it crashes on all versions. I have tried uninstalling/reinstalling both VS and Unreal Engine, but get the same results.

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

1 answer: sort voted first

Hey Snipe3000-

As mentioned here (https://answers.unrealengine.com/questions/179723/47-unrealbuildtool-failed-to-generate-project-file.html) it seems that your %TEMP% folder may have too many files in it and needs to be cleaned up / cleared out. This should free up the space needed to make new projects.


Doug Wilson

more ▼

answered Mar 03 '15 at 12:41 AM

avatar image Snipe3000 Mar 04 '15 at 08:47 AM

I cleared my temp folder, but the result is the same.

avatar image Doug E ♦♦ STAFF Mar 10 '15 at 03:58 PM

I came across another users post that seems to be having a similar issue to what you're describing. Could you try the solution in the post below and let me know if that helps?


avatar image Snipe3000 Mar 12 '15 at 02:24 AM

Thanks so much Doug. This solution didnt really solve the cause of the problem, but repeating the steps for his solution helped me at least find the cause. Turns out I was causing the issue myself, I just didnt how. My buddies and I run our unreal engine launcher through the Steam client, which is cool because broadcast and everything works. I guess at some point, perhaps a steam update caused this to not work any more and causes the error that I showed above. Not sure why though.

Thanks again

PS: if you get bored and feel like looking into the steam client thing, that would be great, but its no big deal.

(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