# Corrupt Visual Studio solution

**URL:** <https://forums.unrealengine.com/t/corrupt-visual-studio-solution/1906928>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine, crash, bug-report, question\
**Created:** [June 17, 2024, 9:32pm UTC](https://forums.unrealengine.com/t/corrupt-visual-studio-solution/1906928 "2024-06-17T21:32:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![TechWiz540](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TechWiz540](https://forums.unrealengine.com/u/TechWiz540)\
**Post date:** [June 17, 2024, 9:32pm UTC](https://forums.unrealengine.com/t/corrupt-visual-studio-solution/1906928/1 "2024-06-17T21:32:32Z")

</div>

I’m using UE5 and vs2022. After trying to regenerate my project files, my c++ solution got corrupted. When I open the file explorer on Windows (Windows 10) and go in the folder containing my solution, File Explorer freezes and then closes on it’s own. Using command lines, I managed to erase the solution.

I tried to generate the project files using the context menu, but the option to generate them isn’t there. I tried using the version selector executable to solve this issue, but it didn’t work. Using the following command line (“D:\Epic Games\UE\_5.4\Engine\Build\BatchFiles\Build.bat” -projectfiles -project=“D:\MyProject.uproject” -game -rocket -progress) I was able to generate the project solution. However, the newly generated solution file was corrupted as well. I reinstalled vs2022 and UE5, but the problem still occurred. I tried to create a new Unreal project, but the problem still occurred. I tried creating a C++ project using vs2022 and everything was fine.

UE5 generates corrupted .sln files, but not vs2022.

Does anyone know how to fix this.

**Update 1:**

Using the following command “Build.bat MyProjectEditor Win64 Development D:\Folder\containing\the\project\MyProject.uproject” I was able to generate the Binaries and Intermediate folders. I’m now able to open my project.

Unfortunately, I’m unable to generate the .sln file. I’ve check online on how to solve this issue. Some said to use the “Generate Project Files” option in the context menu, which isn’t there. Others said to use GenerateProjectFiles.bat, which I couldn’t find in the BatchFiles folder.

For the “Generate Project Files” option, people online said to launch UnrealVersionSelector.exe in the installation folder. It didn’t work.

For the GenerateProjectFiles.bat file, I tried to create it manually using one for UE4, but I quickly realized I have no idea how to adapt it to UE5.

---

<div class="post-metadata">

**Author:** ![TechWiz540](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TechWiz540](https://forums.unrealengine.com/u/TechWiz540)\
**Post date:** [June 18, 2024, 9:29pm UTC](https://forums.unrealengine.com/t/corrupt-visual-studio-solution/1906928/2 "2024-06-18T21:29:55Z")

</div>

This seems to be the answer to the problem.

> [@Unable to generate VS project files for 5.1](https://forums.unrealengine.com/t/unable-to-generate-vs-project-files-for-5-1/717750/2):
>
> Found the solution. For anyone else having this problem: Open the Visual Studio Installer Select ‘modify’ next to Visual Studio 2022 Select ‘Individual components’ Search for ‘MSVC v143 - VS 2022 C++ x64/x86 build tools (v14.30-17.0)’ and check the box Click ‘Modify’ to download the package Wait for it to install Close Visual Studio and Unreal (if open) Delete the .vs , Binaries , Intermediate , Saved folders and YourGame.sln Right click on the uproject file and generate the visual studio fi…

---

<div class="post-metadata">

**Author:** ![FrostyJas](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/frostyjas/32/1194640_2.png) [@FrostyJas](https://forums.unrealengine.com/u/FrostyJas)\
**Post date:** [June 20, 2024, 9:53am UTC](https://forums.unrealengine.com/t/corrupt-visual-studio-solution/1906928/3 "2024-06-20T09:53:39Z")

</div>

Greetings @TechWiz540

Welcome to the Unreal Engine Community Forum. I was going to respond when I saw the original post. But, it seems like you may have made some progress on fixing it. Were you able to resolve it?

---

<div class="post-metadata">

**Author:** ![TechWiz540](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TechWiz540](https://forums.unrealengine.com/u/TechWiz540)\
**Post date:** [June 20, 2024, 7:11pm UTC](https://forums.unrealengine.com/t/corrupt-visual-studio-solution/1906928/4 "2024-06-20T19:11:47Z")

</div>

Mostly. I successfully generated the solution file. Still have one problem though. Before the problem occurred, I was trying to regenerate the vs project files. I added a header file with an enum, but Visual Studio couldn’t recognize anything related to to Unreal Engine. Couldn’t recognize UENUM or UMETA.

From what I saw online, I need to erase the Saved, Intermediate and Binaries folders and, from the uproject file’s context menu, select the “Generate Visual Studio project files” option. Problem is, the option isn’t there. I tried to use UnrealVersionSelector.exe to solve the issue, but it didn’t work ([How to solve the lack of options such as Generate Visual Studio project files in the right-click menu in UE4 and UE5 | Pome](https://www.pome.cc/en/posts/rcm/)). I tried to regenerate the the project’s files by using command lines, to no avail. This lead to the problem I mentioned in the first post.

---

<div class="post-metadata">

**Author:** ![TechWiz540](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TechWiz540](https://forums.unrealengine.com/u/TechWiz540)\
**Post date:** [June 20, 2024, 7:32pm UTC](https://forums.unrealengine.com/t/corrupt-visual-studio-solution/1906928/5 "2024-06-20T19:32:32Z")

</div>

Nevermind, I found the solution. ([Missing 'Generate Visual Studio Project Files' in context menu - #23 by leandros\_1](https://forums.unrealengine.com/t/missing-generate-visual-studio-project-files-in-context-menu/389708/23))

---

<div class="post-metadata">

**Author:** ![FrostyJas](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/frostyjas/32/1194640_2.png) [@FrostyJas](https://forums.unrealengine.com/u/FrostyJas)\
**Post date:** [June 21, 2024, 9:16am UTC](https://forums.unrealengine.com/t/corrupt-visual-studio-solution/1906928/6 "2024-06-21T09:16:13Z")

</div>

Awesome! I’m glad you were able to get it fixed!
