I've been trying to upgrade my ASP.NET project in Visual Studio from the .NET 4.7.2 framework to .NET 5. I can't figure out what the problem is, because I've tried several different things and none of them have made .NET 5 available.
dotnet --version
.The About window in Visual Studio says that my .NET version is 4.8.040. The most recent .NET framework that I can select in my project is 4.7.2. Creating a new project doesn't offer a newer version either.
I want to work with C# 9.0, but my project is stuck in 7.3. Any idea what I'm doing wrong?
Visual Studio 2019 supports the following . NET implementations: . NET version 5 (Visual Studio 16.8 or later)
Go to Tools > Options... , and under Preview Features , tick the Use previous of . NET Core SDK (required restart) checkbox as shown in the following: Now just restart/close Visual Studio 2019 and you should now be able to see ASP.NET Core 5.0 in the list when creating a new project from the default templates.
NET 5.0 component in Visual Studio will be changed to out of support and optional," Microsoft said in a March 24 post. "This means that workloads in Visual Studio may be installed without installing . NET 5.0.
.NET 5 is not a direct replacement for .NET Framework 4.5+. If you try to create a new project and choose .NET Framework, then you will be able to choose for example 4.7, 4.8, but not .NET 5.
You will only find .NET 5 in projects which are .NET Core type.
In summary - you can't switch .NET Framework project to .NET 5 using simple Project Property window. You have to rewrite the application to .NET 5 - which is indeed the next version after .NET Core 3.1.
Regarding your question:
I want to work with C# 9.0, but my project is stuck in 7.3. Any idea what I'm doing wrong?
Please look at the C# language versions page. C# 8.0 is available for netstandard2.1
which is not supported by .NET Framework. Same thing with C# 9.0.
What is .NET 5 in comparison to .NET Core and .NET Framework you can read on Microsoft Dev Blog.
.NET 5 is really the next version of .NET Core, not .NET Framework. .NET Framework is a legacy product that will only see minor maintenance fixes, like security patches, in the future.
Moving from Framework to Core involves dealing with all kinds of breaking changes and is more complicated than simply changing your project's target framework.
For that purpose, Microsoft has a migration guide for ASP.NET, which you can read to learn what you need to change in your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With