I want to us source generators and therefore need a class library that targets netstandard2.0. Unfortunately I can't select it in the JetBrains Rider framework dropdown (see screenshot below).
Rider version: 2021.3.2 (Build: #RD-213.6461.51)
dotnet --info:
.NET SDK (gemäß "global.json"): Version: 6.0.100 Commit:
9e8b04bbffLaufzeitumgebung: OS Name: fedora OS Version: 35 OS Platform: Linux RID: fedora.35-x64 Base Path:
/usr/lib64/dotnet/sdk/6.0.100/Host (useful for support): Version: 6.0.0 Commit: 4822e3c3aa
.NET SDKs installed: 3.1.118 [/usr/lib64/dotnet/sdk] 5.0.206 [/usr/lib64/dotnet/sdk] 6.0.100 [/usr/lib64/dotnet/sdk]
.NET runtimes installed: Microsoft.AspNetCore.App 3.1.18 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.9 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.0 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.18 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.9 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.0 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Framework selection in Rider: Framework dropdown greyed out and set to net6.0
How can I get the framework-selection to let me select netstandard2.0 (and netstandard2.1)?
If you need any other info I'm more then willing to provide it. Thanks in advance.
After I have created a project with the preselected net6.0
framework selection my csproj
looks like this:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
I can manually change the <TargetFramework>
value and everything works (<TargetFramework>netstandard2.0</TargetFramework>
), but I just find it strange that I can't use the dropdown in project creation directly.
It is a bug that has been reported to JetBrains team already: https://youtrack.jetbrains.com/issue/RIDER-70004
As a workaround, following can be done: