Is my .NET Core 3.1 app portable to .NET 5?

Viewed 3003

I'm currently trying to port an ASP .NET Core 3.1 application to .NET 5.0.

In my app I use some 3rd party NuGet packages, which rely on .NET Core 3.1 and will not be ported to .NET 5.

Though I try to figure out if my application is fully portable to .NET 5.

In my app, I did the following steps:

  • I updated the target framework in the .csproj file
<TargetFramework>net5.0</TargetFramework>
  • Then I updated all NuGet packages - it seems to work fine without errors.

Unfortunately I'm not sure, because in Solution Explorer => Project => Dependencies => Frameworks, I see the usage Microsoft.AspNetCore.App and Microsoft.NETCore.App.

enter image description here

My first question is, is it a problem to use Microsoft.AspNetCore.App and Microsoft.NETCore.App in the same .NET 5 app? What is the difference between those Frameworks?

  • In a next step I run the .NET Portability Analyzer with target framework .NET 5.0 - the report says it is about 97% portable - but the dependent NuGets in .NET Core 3.1 cannot be altered.

My second question is, can I use .NET Core 3.1 NuGet packages in a .NET 5 application? I cannot change these 3rd party NuGet packages. It seems to work, but I thought it's not possible.

How can I verify if I can fully port my app from .NET Core 3.1 to .NET 5?

1 Answers

You can. Just upgrade all your project dependencies via NuGet to latest stable version and it will let you upgrade your .Net Core 3.1 to .Net 5. I have recently done on two projects working on. One of them is on Dev server working fine without any issue.

On hosting server you need to install .net 5 Hosting Bundle and restart the server... that's it

Related