How to control Visual Studio version used by Rider when opening a .uproject?

I've modified our platform settings to prefer Visual Studio 2022, and I have both 2019 and 2022 installed. If I generate a .sln for 2022 and open it in Rider, it will build with MSVS2022, but if I open the .uproject it will use VS 2019 to build. How can I tell Rider which VS version to use?

DefaultEngine.ini has:

[/Script/WindowsTargetPlatform.WindowsTargetSettings]
Compiler=VisualStudio2022
5 comments
Comment actions Permalink

Try to set it on `Preferences | Build, Execution, Deployment | Toolset and Build` -> Use MSBuild Version.

0
Comment actions Permalink

Sofia Byzova, thanks, I'll try that! The problem is that every time it uses the wrong version I have to do a clean rebuild of the entire engine, which is very time consuming. (Even if I cancel the 2019 build, it will need to cleanly rebuild with 2022 when I switch back.)

 

I see that it says "Save | Solution 'team-wide'" -- where is that file for the .uproject, and how do I add it to version control for the team to get?

0
Comment actions Permalink

Jorgen

A file <ProjectName>.uproject.DotSettings will be created in the project root directory. So you can put it to your repository. To show it in Solution Explorer, enable a`Show All Files` mode(an eye button).

0
Comment actions Permalink

Sofia Byzova, investigating this again, it doesn't seem to pay attention to the MSBuild version when building with UBT.

 

 

Build output:

Using Visual Studio 2019 14.29.30142 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).

0
Comment actions Permalink

Hi Jorgen,

Rider should not affect this setting, but you should point to the compiler you want using BuildConfiguration.xml:

<WindowsPlatform>
<Compiler>VisualStudio2022</Compiler>
</WindowsPlatform>

If you encounter any issues or find any differences when building the same project in Rider and VS, please let me know.

0

Please sign in to leave a comment.