Hi there, I was facing the same error. Found a solution with google AI - after many attempts -
That’s steps works for me:
(considering that Unreal is installed on disk C on my computer)
Step 01: Take ownership of the folder:
Open the CMD as admin, then paste this commands:
takeown /f “C:\Unreal Engine\UE_4.27” /r /d n
enter. Wait for processing.
icacls “C:\Unreal Engine\UE_4.27” /grant Everyone:F /t
enter. Wait for processing. (I’m a brazilian guy, so I will leave this commentary here: If your Windows is in Portuguese, use Todos:F instead of Everyone:F)
attrib -r “C:\Unreal Engine\UE_4.27*.*” /s /d
enter. Wait for processing.
Step 2: Manually Build UnrealBuildTool (UBT)
I’m using visual studio 2022 and it is installed on C:\Program Files\Microsoft Visual Studio… If you have installed on different folder, may you will have to change the path.
If you don’t close the CMD yet, put these comand: (otherwise, open CMD again has admin)
“C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe” “C:\Unreal Engine\UE_4.27\Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj” /property:Configuration=Development /property:Platform=AnyCPU /p:OutputPath=“C:\Unreal Engine\UE_4.27\Engine\Binaries\DotNET”
enter. Wait for processing.
Step 3: The Subfolder “Trick” (Compatibility Fix)
The UnrealVersionSelector looks for the executable in a subfolder, but if UBT runs from there, it fails to find the Engine Source. To fix this:
-
Go to C:\Unreal Engine\UE_4.27\Engine\Binaries\DotNET.
-
Create a new folder named UnrealBuildTool inside it.
-
Copy (do not move) all the files recently generated in DotNET (the .exe and .dll files) into this new UnrealBuildTool subfolder.
- Tip: Sort by “Date Modified” to find the newly created files easily.
**
Step 4: Register the Engine Installation**
-
Navigate to C:\Unreal Engine\UE_4.27\Engine\Binaries\Win64.
-
Locate UnrealVersionSelector.exe.
-
Right-click it and Run as Administrator.
-
Click Yes when asked to register the directory as an engine installation.
Step 5: Generate Project Files Manually
Run this final command to generate your .sln file. This bypasses the buggy context menu check:
(Again, run this command using CMD has admin)
“C:\Unreal Engine\UE_4.27\Engine\Binaries\DotNET\UnrealBuildTool.exe” -projectfiles -project=“D:/Path/To/YourProject/YourProject.uproject” -game -rocket -progress
Mine project has on disk D. Put the path of you own project.
And that’s it.