Update TFM value with upgrade-assistant command

Sanjay Mishra 1 Reputation point

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.

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

2 answers

Sort by: Most helpful
  1. Lan Huang-MSFT 26,361 Reputation points Microsoft Vendor

    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.
    Upgrade an ASP.NET MVC app to .NET 6 with the .NET Upgrade Assistant
    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) 57,731 Reputation points

    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