Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I update to .Net 5 NuGet packages even if I'm using .Net Core 3.1?

I was looking for some NuGet updates about my project libraries. I see that there are a lot of Microsoft libraries update to v5.0.0.

enter image description here

Based on my knowledge I think these are new dependencies released with .Net 5.0 and I'm not sure that I can update these libraries to latest version using .Net Core 3.1 project.

Can I update to v5.0.0 libraries even if I'm using/building a .Net Core 3.1 project?

like image 836
E.Benedos Avatar asked Nov 11 '20 18:11

E.Benedos


People also ask

Is .NET 5 backwards compatible with .NET Core?

NET Core should run seamlessly on . NET 5 or a later version. In fact, many developers expect that the new APIs found in newly released versions of . NET should also be compatible with the pre-release versions in which those APIs were introduced.

What is the difference between .NET Core 3.1 and .NET 5?

Unlike the jump between ASP.NET and ASP.NET Core, there isn't a major difference between ASP.NET Core 3.1 and ASP.NET Core for . NET 5. Well, certainly not for the startup anyways. ASP.NET Core applications are still built in Console Applications.


1 Answers

Unfortunately, you cannot update many of these newest Nuget packages to 5.0. The reason being is that the newest Nuget package versions are written primarily for .NET 5, and often times Nuget Package Manager will even prevent you from installing them since there are differences in the APIs. With that said, there may be a few spots where it will allow the installation, but I wouldn't recommend it if you plan to keep the application on .NET Core 3.1. Most likely it could cause some inconsistencies that would be hard to debug. Proceed with caution, or upgrade your projects to .NET 5.

like image 65
COleson Avatar answered Sep 21 '22 17:09

COleson