利用.NET Upgrade Assitant对项目进行升级

本教程演示如何把WPF程序从 <TargetFrameworkVersion>v4.8 </TargetFrameworkVersion>升级到<TargetFramework>net8.0-windows</TargetFramework>.

下载并安装.NET Upgrade Assistant - Visual Studio Marketplace

Supported .NET upgrades:

  • .NET Framework to .NET 6+ (including .NET 9.0 Preview)
  • .NET Core to .NET 6+ (including .NET 9.0 Preview)
  • Any .NET version to .NET 6+ (including .NET 9.0 Preview) that is higher than the current version
  • Azure Functions v1, v2, v3 to v4 isolated (targeting net6.0 or net7.0)
  • Xamarin.Forms to MAUI
    • Note: For Xamarin->MAUI .xaml file transformations the Upgrade Assistant includes basic namespace replacements. More comprehensive .xaml file transformations require Visual Studio 17.6.

Supported project types:

  • ASP.NET
  • Azure Functions
  • WPF
  • WinForms
  • Class libraries
  • Console
  • Xamarin.Forms
  • .NET MAUI
  • UWP

Coming soon:

  • WCF to WCF Core upgrade

以上更新信息可在.NET Upgrade Assistant - Visual Studio Marketplace中获取到。

安装过程会默认勾选已安装的Visual Studio版本,我本机用的vs2022 Community版本。

安装成功后,打开你的项目,右击选择项目进行升级。

具体步骤如下图所示:

建议更新到LTS版本。

需要一个项目一个项目的升级,升级完成后如果出现引用错误,可重新添加项目间的引用,然后Clean下Solution,rebuild即可。

PS:Upgrade总共有三种方式,可根据自己项目情况进行选择。默认推荐In-place project upgrade。

相关推荐
1-1=016 小时前
.NET Core 文件系统
.net·.netcore·1024程序员节
IsITGirl17 小时前
VMware Fusion(Mac)Windows ARM 虚拟机 NAT (vmnet8) 报错解决记录
windows·macos·.net·桥接模式
学以智用1 天前
WinForms / WPF / Blazor 项目模板详解
.net
1-1=01 天前
.NET Core 内存管理
.net·.netcore
无风听海2 天前
.NET 10之Span技术总结
.net
1-1=02 天前
.NET Core 配置与选项
.net·.netcore·1024程序员节
mudtools2 天前
在飞书 SDK 上用 Microsoft Agent Framework 搭一个能干活的工作搭子
人工智能·ai·.net·飞书·agent
ChaITSimpleLove2 天前
Layout.WatchDog.NET 1.5.0-beta.3 发布:统一全后端雪花 ID 策略,数据库能力矩阵一览
.net·watchdog·日志记录器·节点资源监控看板·.net专属轻量级日志中心
IT规划师2 天前
MQTT 实战 - 放下炫技,8 年踩坑的真心话与方法论(收官)
物联网·.net