Made an actor in C++ and now UE5 project wont open. C++/SLN/Modules

I was working on a level design. I had most of it done, all I wanted to do was add a day/night cycle. I added a new actor, opened with C++, and then proceeded to make two files. a .cpp and a .h, maybe only 100 lines long. Never re-loaded the SLN or anything. Had the engine open while doing it, so I think it hot-coded it. Closed the engine, went to go do something, and when I came back and re-opened the project, everything went downhill.

I have been trying to fix it for at least 10 hours now. Like, I deleted the two files I made at some point during all of this trying to get it back to the version where it was literally working perfectly fine.

Starts with opening the project file. Tells me
**“The following modules are missing or built with a different engine version: MyProject VisualStudioTools VisualStudioBlueprintDebuggerHelper Would you like to rebuild them now?” **
Click yes, little while later
**“Engine modules are out of date, and cannot be compiled while the engine is running. Please build through your IDE.”
**
So you may say “Well it says right there, build through the IDE.”
From here, I would open the SLN file in VS2022 (And even tried it in Rider) and in VS2022 it just wouldn’t, giving me two errors;

Summary

C:\Users\XXXXX\Documents\Unreal Projects\MyProject\Intermediate\ProjectFiles\UE5.vcxproj : warning : The build tools for Visual Studio 2022 (v143) cannot be found. Install Visual Studio 2022 (v143) to build using the Visual Studio 2022 (v143) build tools.

C:\Users\XXXXX\Documents\Unreal Projects\MyProject\Intermediate\ProjectFiles\UE5.vcxproj : warning : Platform ‘Win64’ referenced in the project file ‘UE5’ cannot be found.

So again, you might say “It says right there, v143 tools can’t be found?” But I assure you, after re-installing VS2022 a few dozen times, the correct v143 and all the other necessary tools are installed.

One important thing;
When I go into the project files, there is a Build folder that does indeed have a Win64 folder. When I open UE5.vcxproj in an editor, it mentions Win64 quite a bit, and one of the lines specifically points towards the C:\Program Files\Epic Games\UE_5.6\Engine\Intermediate\Build\Win64 folder. So…. I don’t know where VS2022 is looking. I ensured the folder exists.

But then some say to change the solution configuration to debug or developer_tool or whatever, which I can’t because the only option is BuiltWithUnrealBuildTool. Also tried with Rider, it said the build was fine, but then when actually trying to use UnrealBuildTool in it to debug, it gives me a whole bunch of other errors.

Summary

Log file: C:\Users\XXXX\AppData\Local\UnrealBuildTool\Log.txt
Creating makefile for MyProject (no existing makefile)
Compiled assembly file ‘C:\Users\XXXX\Documents\Unreal Projects\MyProject\Intermediate\Build\BuildRules\MyProjectModuleRules.dll’ appears to be for a newer CLR version or is otherwise invalid. Unreal Build Tool will try to recompile this assembly now. (Exception: Bad IL format. The format of the file ‘C:\Users\XXXX\Documents\Unreal Projects\MyProject\Intermediate\Build\BuildRules\MyProjectModuleRules.dll’ is invalid.)
C:\Users\XXXX\Documents\Unreal Projects\MyProject\Source\MyProject\MyProject.Build.cs(5,14): error CS0101: The namespace ‘’ already contains a definition for ‘MyProject’
C:\Users\XXXX\Documents\Unreal Projects\MyProject\Source\MyProject\MyProject.Build.cs(7,9): error CS0111: Type ‘MyProject’ already defines a member called ‘MyProject’ with the same parameter types
C:\Users\XXXX\Documents\Unreal Projects\MyProject\Plugins\VisualStudioTools\Source\VisualStudioTools\VisualStudioTools.Build.cs(26,17): warning CS0618: ‘ModuleRules.UnsafeTypeCastWarningLevel’ is obsolete: ‘Deprecated in UE5.6 - Replace with ModuleRules.CppCompileWarningSettings.UnsafeTypeCastWarningLevel’
Expecting to find a type to be declared in a target rules named ‘MyProjectTarget’. This type must derive from the ‘TargetRules’ type defined by UnrealBuildTool.

Result: Failed (RulesError)
Total execution time: 2.06 seconds

Process finished with exit code 8.

And then when I go through and delete intermediate/saved/.vsconfig/myproject.sln and re-generate Visual Studio Project Files, it only adds an intermediate folder, a saved folder, .vsconfig, and the sln. For some reason it is not adding the binaries folder.

At one point the UE5.vcxproj was pointing towards C:\Program Files\Epic Games\UE_5.6\Engine\Plugins\Developer and the Developer folder was just.. Gone for some reason. Reinstalled UE5, it’s back, but that didn’t fix anything.

I have regenerated the visual studio files numerous times, I have uninstalled and reinstalled VS2022 numerous times.

Any solution I’ve seen relating to this has not worked, and I am lost. I genuinely do not know what to do from here. The project was almost done, with most of the level design done, and now it just wont open.

I have not changed my UE version for anything. At most what I can tell is DLLs aren’t being read right. In Rider, a lot of the debug output says stuff along the lines of
”C:\Program Files\Epic Games\UE_5.6\Engine\Binaries\ThirdParty\DotNet\8.0.300\win-x64\shared\Microsoft.NETCore.App\8.0.5\xxxxxxxxxxx.dll was not found or failed to read”

Which, I went in, each of these .dll’s exist, so Im not sure why it can’t read them.

I have thus found a fix and have completely fixed it. Didn’t really get much help from here/discord/forums/etc so for 3 days I kind of just dug around with a lot of trial and error. Here is a github that is simply just a code/text file that explains what happened and how it’s been fixed, I can now at last open my project once again.

TLDR: Check your source folder and make sure it’s correct, and don’t name your project “MyProject”

1 Like