What is the migration guidelines to migrate .NET Core 2.1 apps to .NET 6?

Sivakumar 1 Reputation point
2021-09-17T15:18:19.993+00:00

Hello!

I'm looking for some guidance on migrating .NET Core 2.1 applications to .NET 6(Preview). As .NET 6 is going to be a LTS, I would like to migrate it.

Thanks,
Siva

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,188 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,125 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,686 Reputation points
    2021-09-17T18:29:07.217+00:00

    first upgrade 2.1 to 5.0 with the upgrade assistant tool (this may be complex and will probably require code changes):

    https://dotnet.microsoft.com/platform/upgrade-assistant

    then you can upgrade 5.0 to 6.0 (simple):

    https://learn.microsoft.com/en-us/aspnet/core/migration/50-to-60?view=aspnetcore-5.0&tabs=visual-studio


  2. Zhi Lv - MSFT 32,016 Reputation points Microsoft Vendor
    2021-09-20T02:05:34.913+00:00

    Hi @Sivakumar ,

    You should refer the Migrate document to step by step update an existing ASP.NET Core 2.1 project to ASP.NET Core 6.0, like this: 2.1 to 3.0 => 3.0 to 3.1 => 3.1 to 5.0 => 5.0 to 6.0. In each step, if you meet any error or exception, you can share it on this forum.


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Best regards,
    Dillion

    0 comments No comments

  3. Sreeju Nair 11,616 Reputation points
    2021-09-21T09:15:13.667+00:00

    If you are in 2.1 and need to go directly to 6, you need to refer the migration website. Refer the documentation from 2.1 to 2.2 till 5.0 to 6.0 and understand the changes you will need to make and apply them.

    https://learn.microsoft.com/en-us/aspnet/core/migration/21-to-22?view=aspnetcore-5.0&tabs=visual-studio

    0 comments No comments