Rider selects wrong .net version
Asked Answered
D

1

5

I'm checking out rider, but so far I struggle with that it actually selects the wrong .net sdk. I have those installed according to dotnet --list-sdks:

5.0.202 [C:\Program Files\dotnet\sdk] 5.0.301 [C:\Program Files\dotnet\sdk] 5.0.400-preview.21328.4 [C:\Program Files\dotnet\sdk] 6.0.100-preview.6.21355.2 [C:\Program Files\dotnet\sdk]

Rider automatically selects the 6.0 Preview:

enter image description here

When I now open my blazor project, which is .net 5, I get a dialog asking to manage sdk's. When I select 5.0 and exclude preview versions it upgrade it still automatically to .net 6. With that I can build, but Rider actually warns me that .net 6 is not fully supported. When I create a global.json in my userprofile, the project actually fails to load. I can uninstall .net 6 preview, but that breaks my installation of Visual Studio 2022 preview. Is there really no way to tell Rider what version to actually use? Or to tell it that it should ignore the preview (in a way where it actually does it I mean)?

Derivative answered 19/7, 2021 at 17:59 Comment(0)
I
14

Rider can use any .NET SDK installed on your machine. First of all go to File | Settings | Build, Execution, Deployment | Toolset and Build and ensure .NET Core Cli executable path points to the right dotnet.exe.

Now Rider uses the same .NET SDK which will be used when you call <path-to-dotnet.exe> build from terminal. The second step - create global.json file and specify which SDK you want to use (both in Rider and from command line).

Interpolate answered 19/7, 2021 at 19:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.