Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select desired target .NET version in .NET Upgrade Assistant

My intention is to upgrade my .NET Framework 4.8 projects to .NET 6. Using .NET 6 is important because that is the highest .NET version one of my dependencies supports. I ran the upgrade assistant analyzer on my project and received the following line.

Recommending Windows TFM net7.0-windows because the project either has Windows-specific dependencies or builds to a WinExe

Is there any way to set the target version to .NET 6 in the .NET Upgrade Assistant?

like image 737
John Stritenberger Avatar asked Sep 03 '25 17:09

John Stritenberger


2 Answers

You cannot directly set the specific version, but you can decide whether to use LTS (Long term service release), Current (well, the current realease) or Preview (the next, upcoming version).

You use the --target-tfm-support command line option with either one of these values.

At the time of this writing the situation should be as follows:

  • LTS: net-6.0
  • Current: net-7.0
  • Preview: net-8.0 (or some minor version of net-7.0)

Obviously, this will change over time.

More information and details can be found here.

like image 193
Christian.K Avatar answered Sep 05 '25 05:09

Christian.K


to migrate to .net6.0 I used below command and it worked successfully :

upgrade-assistant upgrade -t LTS project path

For non-interactive I used :

upgrade-assistant upgrade -t LTS --non-interactive project path

as of now .net6.0 is LongTermSupport (LTS)

like image 22
Bang Avatar answered Sep 05 '25 05:09

Bang