Migrate .NET Framework 4.8 to .NET 5

26,994

Solution 1

You didn't mention what's the type of your project. But in general, you should follow the official docs. For example, for winforms projects, see How to migrate a Windows Forms desktop app to .NET 5.

Most likely, as the first thing, you will need to edit your project file manually and change it to the SDK style, as described in the article above:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
   ...
  </PropertyGroup>

</Project>

Solution 2

you can use .NET Upgrade Assistant tool released by Microsoft. This tool will easily convert your .net framework project to .net5.

Solution 3

.NET 5 is the evolution of .NET core. So it is not a trivial change. Firstly, you need to have Visual Studio 2019 (v16.8) (make sure that include .NET in the installation). Second, you need to review if all your NuGet packages and libraries support this (and update it or look for a replacement). Additionally you can take a look if any of the breaking changes affect you https://docs.microsoft.com/en-us/dotnet/core/compatibility/5.0. Keep in mind that .NET 5 is not an LTS, meaning that it will not be supported when .NET 6 comes out.

Depending on your architecture (layers of separations), how big is your solution and if you are using .NET standard for libraries, will depend on the effort you need to do (you might also need to do some refactoring). Anyhow you should plan this thoroughly since is not a trivial migration.

Share:
26,994

Related videos on Youtube

Dave Kapildev
Author by

Dave Kapildev

Skype : dave_kapil2004 Mob : +91 94085 58071 (WhatsApp, Viber, Signal) • Software Development Skill Vast experience in developing client-server and Web applications using .NET, MVC, ASP.NET 4.5, C#.NET, ADO.NET, SQL Server 2008R2, Crystal Report, SSRS, .Net Core, Mono Framework. • Vast experience in developing Mobile App using C# Xamarin.net for Android, IOS and Windows App • Networking Skill Installing and configuration of Network base Software like Microsoft SQL Server, Oracle Installing and configuring a domain, user rights, Active Directory, Domain Controller, IP Address, DHCP. DNS, Firewall, Installing and configuration Linux client • Very good experience in Penetration Testing and Vulnerability Assessment • Very good experience in open source Umbraco CMS, WordPress, Django • Very good experience in Splunk

Updated on July 09, 2022

Comments

  • Dave Kapildev
    Dave Kapildev almost 2 years

    Recently Microsoft has release .NET 5. If we want to upgrade .NET Framework 4.8 to .net 5 then how can we accomplish this task.

    Please Note :

    1. I had already upgrade Visual Studio 18.2 with all latest component and .net Framework 5. But in project property .net 5 is not displayed.

    2. My application is in .net Framework not in .net core.

    Update Feb 02, 2021 Same Question I had posted on Microsoft Forum and luckily they replied very positively.

    https://developercommunity2.visualstudio.com/t/net-framework-48-upgrade-to-net-5/1269991?from=email&viewtype=all#T-ND1352565

    Update August 2021

    Message from Microsoft

    We’ll continue to make the .NET Upgrade Assistant better through previews that will coming out in the GitHub repo. You can find it here: https://github.com/dotnet/upgrade-assistant

    Happy upgrading!

    • Vlad DX
      Vlad DX over 3 years
      Please keep in mind that there are a lot of major versions between .NET Framework 4.8 and .NET Core 5: .NET Core 1, .NET Core 2, .NET Core 3, .NET Core 5. You can't just switch to .NET Core: project files are different, package references defined differently. You need to go through the migration process following the official guides. But if you use 3rd-party libs, they can be incompatible with .NET Core / .NET Standard.
    • Dave Kapildev
      Dave Kapildev over 3 years
      yes you are right, Not Working, 3rd-party libs are incompatible. Some microsoft libs are also incompatible.
    • Hafizullah Ozgur
      Hafizullah Ozgur over 3 years
      You should download .Net 5 from the below link. Like other versions it does not appear. For migration of .net framework 4.8 to .net 5 is not possible right now. .net 5 is under .net core versions. In the future it will most likely be migrated. dotnet.microsoft.com/download
    • pholpar
      pholpar over 2 years
      What do you mean on Visual Studio 18.2? I don't know such VS version. The latest VS version (VS 2022) has currently the version number 17.0.5. There is however a version 18.2 of MS SQL Server Management Studio, that does not make sense in this context.
  • Dave Kapildev
    Dave Kapildev over 3 years
    Not Working, 3rd-party libs are incompatible
  • Dave Kapildev
    Dave Kapildev over 3 years
    Some microsoft libs are also incompatible.
  • aj go
    aj go almost 3 years
    Will it work if the application is .net 5 and the platform is 4.8 .net framework?
  • Dave Kapildev
    Dave Kapildev almost 3 years
    For More detail, please navigate to : developercommunity2.visualstudio.com/t/…
  • Dumindu De Silva
    Dumindu De Silva over 2 years