Failed to generate project files of old 4.x Project

Hello, I am trying to generate Visual Studio project files for an old 4.x UE project of mine.

I received an error log. In particular, this line stands out:
Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.
at UnrealBuildTool.VSCodeProjectFileGenerator.WriteConfiguration(String Name, String ProjectName, IEnumerable1 SourceFiles, CppStandardVersion CppStandard, FileReference CompilerPath, DirectoryReference SysRootPath, Dictionary2 ModuleCommandLines, JsonFile OutFile, DirectoryReference OutputDirectory) in D:\build++UE5\Sync\Engine\Saved\CsTools\Engine\Source\Programs\UnrealBuildTool\ProjectFiles\VisualStudioCode\VSCodeProjectFileGenerator.cs:line 670

I’m now operating on a new computer and my UE5 is installed on my X: drive (not D:). Is there a way I can fix this issue so I can open my project files?

Thanks!

I am on linux and experiencing this same issue after migrating my UE5 installation to a new hard disk. I have pulled the latest source for the git release branch but GenerateProjectFiles.sh still fails with the error cited above:

Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object.
   at UnrealBuildTool.VSCodeProjectFileGenerator.WriteConfiguration(String Name, String ProjectName, IEnumerable`1 SourceFiles, CppStandardVersion CppStandard, FileReference CompilerPath, DirectoryReference SysRootPath, Dictionary`2 ModuleCommandLines, JsonFile OutFile, DirectoryReference OutputDirectory) in /media/cameron/LargeDrive1/code/unreal/UnrealEngine/Engine/Source/Programs/UnrealBuildTool/ProjectFiles/VisualStudioCode/VSCodeProjectFileGenerator.cs:line 670

Did you ever find a solution?