.NET Framework 5.0 doesn't show up as a target framework
Hi, I want to build an ASP.NET Core web app in Rider using the .NET framework version 5. I have the runtime and SDK for .NET framework 5 and I have Rider version 2020.3, which was the version in which .NET framework 5 support was added, but when I try to change my project's framework, the latest target version of the .NET framework that I am seeing is 4.8. What am I doing wrong? I'm quite sure I have the 5.0 runtime and SDK, which is confirmed by me typing "dotnet --info" into the command line. Why won't Rider see .NET 5? I really need 5.0 for my project.
Thanks
Please sign in to leave a comment.
Hi Nick,
Could you share a screenshot of where you try to change project targets?
Also, please share a screenshot of `Preferences | Build, Execution, Deployment | Toolset and Build` and your csproj file.
K.R.
Sofia
I'm not sure what happened to Nick but I'm running into the same issue. I'm running Debian fully updated, dotnet --version shows 5.0.203, and Rider is version 2021.1.2 Being I'm trying to create a new project I don't have a csproj file yet and any that I have created have the TargetFrameworkVersion set to 4.8v because that's the latest available on the drop down. If I manually change that to 5.0 I get errors in my Event Log telling me ".NET Framework Not Installed: MsBuild cannot find TargetFramework assemblies, specify a Mono MSBuild in settings. You can install Mono. Also install msbuild package."
Hi Tke1384,
Could you show your csproj file before and after changing the target, and a screenshot of the "New Solution/Project" window with the expanded Frameworks dropdown?
K.R.
Sofia
I'm not OP, but I have the same problem and this thread is the top result on google:
i tried reinstalling the 5.0sdk, but the installer just tells me its already part of the OS
Hello Christoph,
Please use .NET/.NET Core project templates to create a project targeting .NET 5.
Let me know if it doesn't work for you, or if you have any questions.
ouch, what a beginner mistake. nevermind my comment, everything works fine
Happy to hear everything works fine :)
Have a nice day!
That's all fine and dandy, but how does one convert an existing .NET Framework project into .NET / .NET Core type?
Perhaps the Migration guide from .NET documentation can help?
Another reason why Rider does not allow selecting .Net 5 in the Project Templates:
You are in a Dotnet 5 solution, the Solution SDK settings has Roll-forward policy = Latest Major, and you have Dotnet 6 installed.
Change it to Latest Minor to fix the issue:
Alternatively, locate global.json in your solution root directory, and set it as follows. `allowPrerelease` is not relevant for this issue.