# "System.OutOfMemoryException was thrown" adding c++ classes or generating visual studio project files ( UE 5.1 )

**URL:** <https://forums.unrealengine.com/t/system-outofmemoryexception-was-thrown-adding-c-classes-or-generating-visual-studio-project-files-ue-5-1/722613>\
**Category:** C++\
**Tags:** UE-5, unreal-engine, compile-error, bug-report, CPP, question\
**Created:** [December 6, 2022, 1:36pm UTC](https://forums.unrealengine.com/t/system-outofmemoryexception-was-thrown-adding-c-classes-or-generating-visual-studio-project-files-ue-5-1/722613 "2022-12-06T13:36:29Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![AtomR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AtomR](https://forums.unrealengine.com/u/AtomR)\
**Post date:** [April 21, 2023, 9:46am UTC](https://forums.unrealengine.com/t/system-outofmemoryexception-was-thrown-adding-c-classes-or-generating-visual-studio-project-files-ue-5-1/722613/14 "2023-04-21T09:46:57Z")

</div>

I don’t have a dotnet folder in ProgramFiles so I can’t even try this solution. Anyone know a version of dotnet that for sure works with UE5.1?

[edit]

So the problem is that I only had x86 version of dotnet. Make sure you have the x64 installed and instead of copying and overwriting the dotnet instalation as suggested here, just edit your environmental path variables to have the ProgramFiles dotnet mentioned first and the x86 one mentioned next.

```auto
C:\Program Files\dotnet\
C:\Program Files (x86)\dotnet\

```

As sugested here [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! - #4 by Packetdancer](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)

---

_[View the full topic](https://forums.unrealengine.com/t/system-outofmemoryexception-was-thrown-adding-c-classes-or-generating-visual-studio-project-files-ue-5-1/722613)._
