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

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.

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

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?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

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


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x