C++ Project Could Not Be Compiled in Unreal Engine 5

So, you are trying to create a new C++ project inside Unreal Engine 5, but you encounter an issue… it could not be compiled, and you’re presented with this error:

New C++ UE5 Project
Running D:/UE_5.3/Engine/Build/BatchFiles/Build.bat Development Win64 -Project="D:/GameDev/MyProject/MyProject.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Using bundled DotNet SDK version: 6.0.302
Running UnrealBuildTool: dotnet "..\..\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.dll" Development Win64 -Project="D:/GameDev/MyProject/MyProject.uproject" -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE
Log file: C:\Users\UserName\AppData\Local\UnrealBuildTool\Log.txt
Creating makefile for MyProjectEditor (no existing makefile)
Total execution time: 0.92 seconds
Unable to instantiate module 'SwarmInterface': Could not find NetFxSDK install dir; this will prevent SwarmInterface from installing.  Install a version of .NET Framework SDK at 4.6.0 or higher.
(referenced via Target -> Launch.Build.cs -> SessionServices.Build.cs -> Core.Build.cs -> Virtualization.Build.cs -> SourceControl.Build.cs -> RenderCore.Build.cs -> RHI.Build.cs -> D3D11RHI.Build.cs -> Engine.Build.cs -> AppFramework.Build.cs -> SlateReflector.Build.cs -> PropertyEditor.Build.cs -> EditorConfig.Build.cs -> UnrealEd.Build.cs)

Anyone who programs games, whether they’re new or experienced, is bound to encounter annoying and confusing compilation errors.

Figuring out the solution is just part of game development.

So, what can you do to fix it? Let’s get to it!

Solution 1: NetFxSDK and SwarmInterface

In my case, as you can see in the error code above, it is written clearly:

‘Install a version of .NET Framework SDK at 4.6.0 or higher.’

Since it is not installed, Unreal Engine couldn’t find the NetFxSDK install directory, and this will prevent SwarmInterface from installing.

1. Open Visual Studio Installer

You can find it by searching ‘Visual Studio Installer’ in your Windows search bar.

Windows Visual Studio Installer

If it’s not there, download Visual Studio from the Microsoft website.

2. Install NET Framework 4.6.0 or higher

  1. Click on ‘Modify.’
  2. In the new window, click ‘Individual components.’
  3. Select ‘.NET Framework 4.6.1 SDK’ and ‘.NET Framework 4.6.1 targeting pack,’ or a higher version.
  4. Finally, press the ‘Modify’ button at the bottom right.
  5. Now, Visual Studio will start installing the selected .NET Framework.
How to install NET Framework SDK Unreal Engine

Solution 2: BuildConfiguration.xml

In case you are experiencing errors unrelated to NetFxSDK, consider trying the following solution.

Go to your Windows user folder and search for the file named ‘BuildConfiguration.xml‘.

Windows Path:
C:\Users\YourUserName\AppData\Roaming\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml

Simply delete this file or move it to another folder, and then restart the engine.

The file will be automatically generated again when you reopen the engine.

How to Verify Files in Unreal Engine?

If nothing seems to be working, I recommend going to the Epic Games Launcher.

Select Unreal Engine and navigate to the Library.

Click on the arrow next to ‘Launch’ and select ‘Verify‘ to check the engine files.

In case something went wrong with the installation, this should fix it.

Verify Files in Unreal Engine

I hope this helps.

While I’m certain it doesn’t cover all possible compilation errors, I will continue updating this post as I come across more errors related to C++ inside Unreal Engine.