解密密码请看压缩包注释?“我将 20 年前开发的操作系统迁移到 .NET 6!
作者 | Scott Hanselman译者 | 弯月出品 | CSDN(ID:CSDNnews)早在2001年,我用C#为学校的一门300系列的操作系统课程编写了一个微型虚拟操作系统,后来在2002年将其移植到了VB.NET。这些都是在.NET Core出现之前的代码,基于Windows早期的.NET 1.1或2.0。五年前,我将代码转移到了GitHub上,同时将项目移植到了.NET Core 2.0。当时这个项目已经有15年历史了,所以这个项目能在Windows、Linux、Docker上运行,甚至能在树莓派等项目创立时尚未存在的机器上运行。在本文中,我想尝试一下能否利用.NET升级助手,将这个已有20年历史的项目搬到.NET 6上运行。下面,我们开始:$ upgrade-assistant upgrade .\TinyOS.sln-----------------------------------------------------------------------------------------------------------------Microsoft .NET Upgrade Assistant v0.3.256001+3c4e05c787f588e940fe73bfa78d7eedfe0190bdWe are interested in your feedback! Please use thefollowing link to open a survey: https://aka.ms/DotNetUASurvey-----------------------------------------------------------------------------------------------------------------[22:58:01 INF] Loaded 5 extensions[22:58:02 INF] Using MSBuild from C:\ProgramFiles\dotnet\sdk\6.0.100\[22:58:02 INF] Using Visual Studio install from C:\ProgramFiles\Microsoft Visual Studio\2022\Preview [v17][22:58:06 INF] Initializing upgrade step Select anentrypoint[22:58:07 INF] Setting entrypoint to only project insolution: C:\Users\scott\TinyOS\src\TinyOSCore\TinyOSCore.csproj[22:58:07 INF] Recommending executable TFM net6.0 becausethe project builds to an executable[22:58:07 INF] Initializing upgrade step Select project toupgrade[22:58:07 INF] Recommending executable TFM net6.0 becausethe project builds to an executable[22:58:07 INF] Recommending executable TFM net6.0 becausethe project builds to an executable[22:58:07 INF] Initializing upgrade step Back up project升级过程是交互式的命令行,使用了有颜色的提示信息,还有一系列带有动态选项的问题:有意思的是,升级之后构建一次成功,没有任何错误。手工检查.csproj文件时,我发现了一些奇怪的数字,很像是来自多年前的.NET Core 2。我的直觉告诉我这里有问题,而升级助手并没有理解。
END
《新程序员001-004》全面上市,对话世界级大师,报道中国IT行业创新创造
成就一亿技术人