upgrading from .net framework 4.7.2 to net 6 using upgrade-assistant upgrades to .net standard 2.0 instead

Viewed 3284

I am trying to upgrade projects inside a solution from .net framework 4.7.2 to net6.0 however after the first project (class library) has been upgraded it results in .net standard 2.0 not net 6.0. The Assistant version being used is (version '0.3.261602'). I;ve also installed the net 6 sdk

i am using the commands provided Here

below are the commands ive tried and the results

upgrade-assistant upgrade --target-tfm-support lts "C:\Users\..\..\mySolution.sln" 
upgrade-assistant upgrade --target-tfm-support "C:\Users\..\..\mySolution.sln"

both commands result in upgrades to .net standard 2.0

upgrade-assistant upgrade --target-tfm-support latest "C:\Users\..\..\mySolution.sln" 

error: Cannot parse argument 'latest' for option '--target-tfm-support' as expected type Microsoft.DotNet.UpgradeAssistant.UpgradeTarget.

upgrade-assistant upgrade --target-tfm-support net6.0 "C:\Users\..\..\mySolution.sln" 

error: Cannot parse argument 'net6.0' for option '--target-tfm-support' as expected type Microsoft.DotNet.UpgradeAssistant.UpgradeTarget.

below is result after project was upgraded

1. [Complete] Back up project
2. [Complete] Convert project file to SDK style
3. [Complete] Clean up NuGet package references
4. [Complete] Update TFM
5. [Complete] Update NuGet Packages
6. [Complete] Add template files
7. [Complete] Upgrade app config files
    a. [Complete] Convert Application Settings
    b. [Complete] Convert Connection Strings
    c. [Complete] Disable unsupported configuration sections
8. [Complete] Update source code
    a. [Complete] Apply fix for UA0002: Types should be upgraded
    b. [Complete] Apply fix for UA0012: 'UnsafeDeserialize()' does not exist
9. [Next step] Move to next project
2 Answers

Ok so i think it may do this if there are refrences to nuget packages which are still pointing to .net framework. but in i=eiterh case swicthing it from .net standard to .net 6 worked

Let your upgrade complete, then click edit project file and change your TargetFramework from netstandard 2.0 to Net 6.0. Build you project it will start support to .Net 6.0.

enter image description here

Related