Failed to generate project files. ArgumentOutOfRangeException

I am currently attempting to use C++ with Unreal Engine for first time. However, whenever I attempt to create a new project it says that it failed to generate project files and gives me following error message:

Failed to generate project files. Log output:
Running C:/Program Files/Epic Games/4.5/Engine/Binaries/DotNET/UnrealBuildTool.exe -projectfiles -project="C:/Users/nint8835/Documents/Unreal Projects/LetsGetCPPWorking/LetsGetCPPWorking.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.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   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)

Any help would be appreciated!

Hi nin8835,

Are you using binary version of editor (downloaded through Launcher) and creating a C++ project through that, or have you built engine from source?

I am using binary version of editor.

Hi nint8835,

Do you have same issue if you create a Blueprint project and then add a code class to it?

Could you please download this file and place it on your desktop. Remove .txt extension and run file. It will create a new Info.txt file on your desktop. If you could upload that here, it may give us some idea of what is going on.

Im having this problem too. Nothing I’ve done has been able to resolve it. Error only happens when trying to create a c++ project.

Hi ,

Could you please download this file and place it on your desktop. Remove .txt extension and run file. It will create a new info.txt file on your desktop. If you could upload that here, it may help us determine what is happening.

Here is log file. I’m still having this issue.
link text

Sorry for delay in getting back to you on this. Could you please confirm exactly which version of Visual Studio 2013 you are using?

VS 2013 Ultimate

Hey -

Since we are currently providing support for your issue in another post (Failed to generate project files, System.ArgumentOutOfRangeException - C++ - Epic Developer Community Forums) we will continue to focus attention there rather than in this thread.

Hey nint8835-

We’ve not heard from you in some time. I will be marking this post as resolved for tracking purposes, however if you are still having problems creating a new C++ project please feel free to reopen this post and we will continue to investigate.

Cheers

Thanks .
For those that find themselves here: You get this exact error if you try to run your unreal engine launcher through Steam client.