# My c++ project fails to load, but blueprints works fine in UE5

**URL:** <https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325>\
**Category:** Getting Started & Setup\
**Tags:** error, unreal-engine, UE5-0, bug-report, question\
**Created:** [November 20, 2022, 10:09pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325 "2022-11-20T22:09:54Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![HejHejSwe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HejHejSwe](https://forums.unrealengine.com/u/HejHejSwe)\
**Post date:** [November 20, 2022, 10:09pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/1 "2022-11-20T22:09:54Z")

</div>

When i try to load up a new project this error pops up.

It says stuff like

System.OutOfMemoryException: Exception of type ‘System.OutOfMemoryException’ was thrown.

Running C:/Program Files/Epic Games/UE\_5.1/Engine/Build/BatchFiles/Build.bat -projectfiles -project=“D:/UnrealGameProjects/FireAtCommandTest/FireAtCommandTest.uproject” -game -rocket -progress  
Running UnrealBuildTool: dotnet “…..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll” -projectfiles -project=“D:/UnrealGameProjects/FireAtCommandTest/FireAtCommandTest.uproject” -game -rocket -progress  
Log file: C:\Users\Admin\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(List`1 InPlatforms, List`1 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

---

<div class="post-metadata">

**Author:** ![roccodimaio](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@roccodimaio](https://forums.unrealengine.com/u/roccodimaio)\
**Post date:** [November 23, 2022, 4:04pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/2 "2022-11-23T16:04:02Z")

</div>

Not very helpful to the OP but I am also getting the same error when trying to create C++ projects in Unreal 5.1.

Actions taken with no results:  
Upgrade Visual Studio to latest version of 2022  
Changed Source Code preference in the editor to Visual Studio 2022  
Tried to create both a Blank and Third Person C++ project  
Confirmed it is not a physical memory issue

---

<div class="post-metadata">

**Author:** ![Demonrras](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Demonrras](https://forums.unrealengine.com/u/Demonrras)\
**Post date:** [November 24, 2022, 4:33pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/3 "2022-11-24T16:33:04Z")

</div>

same issue here

---

<div class="post-metadata">

**Author:** ![ZenLeviathan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/zenleviathan/32/551307_2.png) [@ZenLeviathan](https://forums.unrealengine.com/u/ZenLeviathan)\
**Post date:** [November 24, 2022, 6:06pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/4 "2022-11-24T18:06:00Z")

</div>

@roccodimaio  
Are you also updating your .NET Core when updating Visual Studio?  
-Zen

---

<div class="post-metadata">

**Author:** ![MusicalKiwi](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MusicalKiwi](https://forums.unrealengine.com/u/MusicalKiwi)\
**Post date:** [November 24, 2022, 7:49pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/5 "2022-11-24T19:49:35Z")

</div>

Same issue for me. Creating a new C++ project in 5.0 works fine but 5.1 throws ‘System.OutOfMemoryException’. 5.1 Blueprint project works fine as well.  
I did a reinstall of Visual Studio and Unreal, redownloaded and installed the necessary packages but the issue still persists.

---

<div class="post-metadata">

**Author:** ![SocketSwagger](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SocketSwagger](https://forums.unrealengine.com/u/SocketSwagger)\
**Post date:** [November 26, 2022, 8:56pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/6 "2022-11-26T20:56:44Z")

</div>

I was able to solve this issue by updating my .NET sdk to 7.0.100 and restarting the computer.

---

<div class="post-metadata">

**Author:** ![Onoa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Onoa](https://forums.unrealengine.com/u/Onoa)\
**Post date:** [November 27, 2022, 4:45am UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/7 "2022-11-27T04:45:22Z")

</div>

I was hoping that your solution would fix the issue for me, but it didn’t unfortunately.

Would you mind listing the following details of your install?

- Visual Studio Version
- Screenshot of all the components installed
- Your Windows version

I’ve been trying to fix this issue for 1 week now, without success so far. It’s clearly a dependency that’s missing, most probably related to a .NET component, but I can’t find the missing one.

What I have tried so far:

- Clean install and attempt with VS 2019 and also 2022 and following the 5.1 Visual Studio setup documentation page. Clean install of the engine. Same error. I even tried on another computer that never had Unreal Engine or VS installed on.

- Installing .NET sdk to 7.0.100 and rebooting.

Thanks!

---

<div class="post-metadata">

**Author:** ![SocketSwagger](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SocketSwagger](https://forums.unrealengine.com/u/SocketSwagger)\
**Post date:** [November 27, 2022, 5:04pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/8 "2022-11-27T17:04:01Z")

</div>

I am using VS 2022 - 17.4.1

These are the installed components

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/f/24f3c379cf9a05f735cc5f1260ec8f33d18ecc5f.png)

And options

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/7/6974403c6b7ee5cb97a15ca55156a840161fec9c.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/8/69853e7362eb69e08dc21e0aaec68ff1329dca20.png)

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/b/f/ebf70391e2aacf9e9d73c66e696a593c44b2dc39.png)

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/7/77769958f778ed0b7c8e5e1e1e9e5ee32189357c.png)

My Windows version is 10.0.22621

* * *

When I was trying to fix the issue I noticed, that my .NET was installed in C:\programs\dotnet and i still had an old sdk version in C:\programs (x86)\dotnet.  
I then copied the newer sdk over.  
Maybe that will fix the problem for you aswell.

---

<div class="post-metadata">

**Author:** ![Onoa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Onoa](https://forums.unrealengine.com/u/Onoa)\
**Post date:** [November 27, 2022, 11:58pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/9 "2022-11-27T23:58:52Z")

</div>

It’s working. I did not install or remove anything from my current configuration but like you, I also had another install of .NET in C:\programs (x86)\dotnet. Copied the newest install over this one and now it works. Something is wrong with the installation process then.

Thank you!

---

<div class="post-metadata">

**Author:** ![geverk](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@geverk](https://forums.unrealengine.com/u/geverk)\
**Post date:** [November 29, 2022, 2:08pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/10 "2022-11-29T14:08:04Z")

</div>

Same for me the old dotnet folder was messing around…  
Thank you!

---

<div class="post-metadata">

**Author:** ![Doctor\_Kannon](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/doctor_kannon/32/1130101_2.png) [@Doctor\_Kannon](https://forums.unrealengine.com/u/Doctor_Kannon)\
**Post date:** [February 7, 2023, 10:42pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/11 "2023-02-07T22:42:19Z")

</div>

Same problem. I can only open a 5.1.1 project in BP. A C++ project throws an exception:  
`Unhandled exception: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.`

Win10, VS2019.

Where can I find the .NET SDK you are copying over?

I have:  
C:\Program Files (x86)\dotnet\sdk\3.1.409  
A:\Software\Epic\UE\_5.1\Engine\Binaries\ThirdParty\DotNet\6.0.302\{etc}

---

<div class="post-metadata">

**Author:** ![stonman](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/stonman/32/489727_2.png) [@stonman](https://forums.unrealengine.com/u/stonman)\
**Post date:** [March 20, 2023, 3:13pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/12 "2023-03-20T15:13:20Z")

</div>

I found this solution here for this same problem.

> [@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!](https://forums.unrealengine.com/t/help-ive-been-trying-to-create-a-c-project-in-ue5-but-every-time-i-create-a-project-it-gives-me-this-error-message/728343/4):
>
> 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 swit…

---

<div class="post-metadata">

**Author:** ![Onoa](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Onoa](https://forums.unrealengine.com/u/Onoa)\
**Post date:** [April 1, 2023, 11:54pm UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/13 "2023-04-01T23:54:40Z")

</div>

The old one is: C:\Program Files (x86)\dotnet

And the new one is: C:\Program Files\dotnet.

Copy the content of the new one to the old one.

---

<div class="post-metadata">

**Author:** ![Engene\_Hsuan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/engene_hsuan/32/706297_2.png) [@Engene\_Hsuan](https://forums.unrealengine.com/u/Engene_Hsuan)\
**Post date:** [October 25, 2023, 9:27am UTC](https://forums.unrealengine.com/t/my-c-project-fails-to-load-but-blueprints-works-fine-in-ue5/695325/14 "2023-10-25T09:27:05Z")

</div>

it save me. 👍 👍 👍 👍
