UBT generates Visual Studio solution files when the preferred source code editor is “Rider Uproject”, which doesn’t use them

Summary

Rider’s “Uproject” mode opens the .uproject directly and doesn’t need a .sln or .slnx. But when the editor runs project-file generation (for example when you create a new C++ project, or use Tools → Refresh Visual Studio Project), UnrealBuildTool still writes Visual Studio solution files if Rider Uproject is the preferred source code editor.

UBT picks the format in GenerateProjectFilesMode.cs. It checks, in this order:

  1. Formats given on the command line
  2. ProjectFileGenerator.Format in BuildConfiguration.xml
  3. The editor’s PreferredAccessor setting, through ProjectFileGenerator.GetPreferredSourceCodeAccessor()
  4. BuildHostPlatform.GetDefaultProjectFileFormats(), which on Windows is ProjectFileFormat.VisualStudio

GetPreferredSourceCodeAccessor() (Engine/Source/Programs/UnrealBuildTool/ProjectFiles/ProjectFileGenerator.cs) only recognises the CLion, CodeLite, Xcode, VS Code, KDevelop and Visual Studio accessor names. It has no entry for any Rider accessor name, including “RiderUproject”. So it returns false, and UBT falls back to the Windows default and generates a Visual Studio solution. The editor’s preference is effectively ignored for Rider users.

Engine version: 5.8.4 (source build), Windows.

What Type of Bug are you experiencing?

Editor

Steps to Reproduce

  1. On Windows, install JetBrains Rider with Unreal Engine support.
  2. In Editor Preferences → General → Source Code, set Source Code Editor to “Rider Uproject”. Check that [/Script/SourceCodeAccess.SourceCodeAccessSettings] PreferredAccessor=RiderUproject is saved in the editor settings.
  3. Don’t set ProjectFileGenerator.Format in BuildConfiguration.xml.
  4. Create a new project from a C++ template (File → New Project → Games → Blank → C++), or open an existing C++ project with no solution files and run Tools → Refresh Visual Studio Project.
  5. Look at the project folder.

Expected Result

UBT recognises the Rider accessor names, including “RiderUproject”, in GetPreferredSourceCodeAccessor(). Since Rider Uproject mode works from the .uproject alone, UBT should generate only what Rider needs and no Visual Studio solution files.

Observed Result

UBT writes Visual Studio solution and project files (.sln/.slnx, plus the .vcxproj files under Intermediate/ProjectFiles) next to the .uproject. This is the same output as if Visual Studio were the selected editor. The UBT log shows it generating Visual Studio project files, and the editor’s preferred-accessor setting has no effect.

Affects Versions

5.8

Platform(s)

Windows