Help! I've been trying to create a C++ project in UE5 but every time I create a project it gives me this error message!

This is the following message it gives me, any help would be appreciated:

An error occurred while trying to generate project files.

Running C:/Program Files/Epic Games/UE_5.1/Engine/Build/BatchFiles/Build.bat -projectfiles -project=“C:/Users/Usuario/Desktop/MyProject3/MyProject3.uproject” -game -rocket -progress
Running UnrealBuildTool: dotnet “…..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” -projectfiles -project=“C:/Users/Usuario/Desktop/MyProject3/MyProject3.uproject” -game -rocket -progress
Log file: C:\Users\Usuario\AppData\Local\UnrealBuildTool\Log_GPF.txt

Some Platforms were skipped due to invalid SDK setup: IOS, Android, Linux, LinuxArm64.
See the log file for detailed information

Discovering modules, targets and source code for project…
Binding IntelliSense data…
Binding IntelliSense data… 100%
Writing project files…
Writing project files… 0%
Unhandled exception: System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.
at System.Text.StringBuilder.ToString()
at UnrealBuildTool.VCProjectFile.WriteProjectFile(List1 InPlatforms, List1 InConfigurations, PlatformProjectGeneratorCollection PlatformProjectGenerators, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudio\VCProject.cs:line 1381
at UnrealBuildTool.ProjectFileGenerator.WriteProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 2812
at UnrealBuildTool.VCProjectFileGenerator.WriteProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudio\VCProjectFileGenerator.cs:line 480
at UnrealBuildTool.ProjectFileGenerator.GenerateProjectFiles(PlatformProjectGeneratorCollection PlatformProjectGenerators, String[] Arguments, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\ProjectFileGenerator.cs:line 1176
at UnrealBuildTool.GenerateProjectFilesMode.Execute(CommandLineArguments Arguments, ILogger Logger) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\Modes\GenerateProjectFilesMode.cs:line 233
at UnrealBuildTool.UnrealBuildTool.Main(String[] ArgumentsArray) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.cs:line 648

It looks like you ran out of space?

Did you found answer?

Open the Windows command prompt, then run where.exe dotnet – it will return one or more paths containing a dotnet.exe executable.

If it looks like, for instance:

C:\Program Files\dotnet\dotnet.exe
c:\program files (x86)\dotnet\dotnet.exe

…then you are okay. If the (x86) line is first, however, that will cause UE5.1 to use the 32-bit version of the dotnet executable… and it will run out of memory during the build process.

If that’s the case, you want to go to your computer’s settings and switch the order of paths so that the 64-bit one (e.g. the one without (x86) in the path) comes first.

Open Explorer, go to “This PC” (or “My Computer” or whatever), right-click and get “Properties”, and then click on “Advanced System Settings”. From there, click on “Environment Variables”, scroll down until you find the variable named Path and edit it appropriately.

If things are already in the right order, you may have some other underlying issue (like genuinely not having enough memory).

7 Likes

Your solution worked very well. Thank you very much. :sob:

1 Like

You’re right