question

Sivakumar-8593 avatar image
0 Votes"
Sivakumar-8593 asked NagendranArunPrakash-2668 published

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

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

dotnet-aspnet-core-generaldotnet-runtime
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Bruce-SqlWork avatar image
0 Votes"
Bruce-SqlWork answered NagendranArunPrakash-2668 published

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://docs.microsoft.com/en-us/aspnet/core/migration/50-to-60?view=aspnetcore-5.0&tabs=visual-studio

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Are you sure this will work? I tried using the upgrade assistant and it didnt upgrade. It seems the assistant is only for .net framework to .net core, and not from .net 2.1 to .net 6. Also, in the upgrade assistant, there is no way for me to provide the target framework. All we can provide is the TFM and for LTS, we have 3.1 and 6 as well. Not sure which one will the upgrade-assistant will point to. Any pointers in this regards is greatly appreciated.

0 Votes 0 ·
ZhiLv-MSFT avatar image
0 Votes"
ZhiLv-MSFT answered

Hi @Sivakumar-8593,

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

sreejukg avatar image
0 Votes"
sreejukg answered

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://docs.microsoft.com/en-us/aspnet/core/migration/21-to-22?view=aspnetcore-5.0&tabs=visual-studio

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.