【发布时间】:2021-12-24 16:30:08
【问题描述】:
我正在尝试将解决方案中的项目从 .net 框架 4.7.2 升级到 net6.0,但是在第一个项目(类库)升级后,它会导致 .net 标准 2.0 而不是 net 6.0。正在使用的助手版本是(版本“0.3.261602”)。我也安装了net 6 sdk
我正在使用Here提供的命令
以下是我尝试过的命令和结果
upgrade-assistant upgrade --target-tfm-support lts "C:\Users\..\..\mySolution.sln"
upgrade-assistant upgrade --target-tfm-support "C:\Users\..\..\mySolution.sln"
这两个命令都会导致升级到 .net 标准 2.0
upgrade-assistant upgrade --target-tfm-support latest "C:\Users\..\..\mySolution.sln"
错误:无法将选项“--target-tfm-support”的参数“最新”解析为预期类型 Microsoft.DotNet.UpgradeAssistant.UpgradeTarget。
upgrade-assistant upgrade --target-tfm-support net6.0 "C:\Users\..\..\mySolution.sln"
错误:无法将选项“--target-tfm-support”的参数“net6.0”解析为预期类型 Microsoft.DotNet.UpgradeAssistant.UpgradeTarget。
以下是项目升级后的结果
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
【问题讨论】:
标签: .net-6.0 .net-4.7.2