Update TFM value with upgrade-assistant command

Sanjay Mishra 1 Reputation point
2022-03-17T21:10:22.98+00:00

While migrating MVC (.net framework 4.8) application to .Net 5, the step three (Update TFM) in upgrade-assistant flow, it always updating my project to 'netStandard2.0' instead of '.net5'. How can I point this to use .net5?

Thank you.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,417 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Lan Huang-MSFT 28,841 Reputation points Microsoft Vendor
    2022-03-18T03:21:34.267+00:00

    Hi @Sanjay Mishra ,
    First familiarize yourself with the entire upgrade process to determine the feasibility of the upgrade. Once done, you can install the .NET Upgrade Assistant and start upgrading your projects to the latest version of .NET.

    Updating the TFM is done by changing the target framework moniker (TFM) used in the project <TargetFramework> attribute to retarget to the latest version of .NET.

    I suggest you take a look at the relevant documentation, which provides detailed steps and explanations.
    https://devblogs.microsoft.com/dotnet/introducing-the-net-upgrade-assistant-preview
    Upgrade an ASP.NET MVC app to .NET 6 with the .NET Upgrade Assistant
    https://github.com/dotnet/upgrade-assistant#troubleshooting-common-issues
    https://learn.microsoft.com/en-us/answers/questions/669564/upgrading-from-net-framework-452-to-net-standard-2.html
    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.

    0 comments No comments

  2. Bruce (SqlWork.com) 61,731 Reputation points
    2022-03-18T15:52:16.117+00:00

    the default for class libraries is .net standard 2.0 (C# 7) which makes them compatible with 4.8 and core. in VS or in the project file you can just update to a later .net core/standard version, and get additional api's and c# language features.

    note: as .net 5 support ends in May, you should skip 5..0, and upgrade to .net 6.0 LTS (requires VS 2022 or visual studio code)

    0 comments No comments