Error Creating C++ Project in Unreal Engine 5.4.1

I’m trying to create a C++ project in Unreal Engine 5.4.1, but I’m encountering the following error when generating project files:

An error occurred while trying to generate project files.

Running C:/Unreal/UE_5.4/Engine/Build/BatchFiles/Build.bat -projectfiles -project="C:/Unreal/MyCppProject/MyCppProject.uproject" -game -rocket -progress
Using bundled DotNet SDK version: 6.0.302
Building UnrealBuildTool with dotnet...
Microsoft (R) Build Engine version 17.2.0+41abc5629 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Unreal\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Horde\Storage\Bundles\BundleCache.cs(62,12): error CS0246: The type or namespace name 'MemoryCache' could not be found (are you missing a using directive or an assembly reference?) [C:\Unreal\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Horde\EpicGames.Horde.csproj]
C:\Unreal\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Horde\Storage\Bundles\BundleCache.cs(63,12): error CS0246: The type or namespace name 'MemoryCache' could not be found (are you missing a using directive or an assembly reference?) [C:\Unreal\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Horde\EpicGames.Horde.csproj]

Build FAILED.

C:\Unreal\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Horde\Storage\Bundles\BundleCache.cs(62,12): error CS0246: The type or namespace name 'MemoryCache' could not be found (are you missing a using directive or an assembly reference?) [C:\Unreal\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Horde\EpicGames.Horde.csproj]
C:\Unreal\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Horde\Storage\Bundles\BundleCache.cs(63,12): error CS0246: The type or namespace name 'MemoryCache' could not be found (are you missing a using directive or an assembly reference?) [C:\Unreal\UE_5.4\Engine\Source\Programs\Shared\EpicGames.Horde\EpicGames.Horde.csproj]
    0 Warning(s)
    2 Error(s)

Time Elapsed 00:00:01.27
ERROR: Failed to build UnrealBuildTool.

Installed .NET SDKs:
6.0.320 [C:\Program Files\dotnet\sdk]
8.0.101 [C:\Program Files\dotnet\sdk]
9.0.300 [C:\Program Files\dotnet\sdk]

Troubleshooting Attempts:
Used Visual Studio 17.8 (as recommended in UE5.4 documentation) with all required components installed.
Also tested with the latest Visual Studio version - same result.
Could you please advise how to resolve this issue? Thanks.

Edit:
At one point I was able to create the project, but encountered different errors. In attempting to resolve them, I installed and uninstalled various components (.NET, MSVC tools, etc.), which may have left my environment in a broken state.
Is there a recommended way to completely reset my development environment to a clean state for UE5.4.1? I’d prefer to start fresh with proper installation rather than troubleshooting the current configuration.

reinstalling windows would be the cleanest way.

otherwise you could try uninstalling visualstudio but it think it leaves all the packages behind.
and windows is notorious for leaving traces of everything behind even after uninstalling.