6

dotnet 自动迁移 VS 2017 以前的 csproj 转为 dotnet core 的 SDK Style 风格工具

 3 years ago
source link: https://lindexi.gitee.io/post/dotnet-%E8%87%AA%E5%8A%A8%E8%BF%81%E7%A7%BB-VS-2017-%E4%BB%A5%E5%89%8D%E7%9A%84-csproj-%E8%BD%AC%E4%B8%BA-dotnet-core-%E7%9A%84-SDK-Style-%E9%A3%8E%E6%A0%BC%E5%B7%A5%E5%85%B7.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
dotnet 自动迁移 VS 2017 以前的 csproj 转为 dotnet core 的 SDK Style 风格工具

本文来安利大家一个特别好用的工具,可以自动将 VisualStudio 2017 以前版本创建的 Franken-proj 格式 的 csproj 项目文件转换为 dotnet core 的 SDK Style 风格的csproj 项目文件的工具

这是一个在 GitHub 上完全开源的仓库,请看 https://github.com/dotnet/try-convert

使用方法很简单,这个工具设计为 dotnet tool 工具,使用之前先使用下面命令进行安装

dotnet tool install -g try-convert

接着进入到需要转换的项目所在的文件夹

cd 需要转换的项目所在的文件夹

使用下面命令进行自动化转换

try-convert

默认能将 csproj 转换好

但是有些古老的项目比较复杂,如 WPF 的项目,此时因为有 AssemblyInfo.cs 文件需要额外处理,此时还请参阅 解决从旧格式的 csproj 迁移到新格式的 csproj 格式 AssemblyInfo 文件值重复问题的方法解决 提示 特性重复的编译出现 CS0579 重复

    Error CS0579: “System.Reflection.AssemblyCompanyAttribute”特性重复 (1, 1)

更多细节请看 从以前的项目格式迁移到 VS2017 新项目格式

参考上面博客修复构建问题,或者进行手工转换项目

如果对工具使用有任何问题,欢迎到 https://github.com/dotnet/try-convert 提反馈,千万不要过来问我,因为这不是我做的

更多参考博客请看


本文会经常更新,请阅读原文: https://blog.lindexi.com/post/dotnet-%E8%87%AA%E5%8A%A8%E8%BF%81%E7%A7%BB-VS-2017-%E4%BB%A5%E5%89%8D%E7%9A%84-csproj-%E8%BD%AC%E4%B8%BA-dotnet-core-%E7%9A%84-SDK-Style-%E9%A3%8E%E6%A0%BC%E5%B7%A5%E5%85%B7.html ,以避免陈旧错误知识的误导,同时有更好的阅读体验。

如果你想持续阅读我的最新博客,请点击 RSS 订阅,推荐使用RSS Stalker订阅博客,或者前往 CSDN 关注我的主页

本作品采用 知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。欢迎转载、使用、重新发布,但务必保留文章署名林德熙(包含链接: https://blog.lindexi.com ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请 与我联系

无盈利,不卖课,做纯粹的技术博客

以下是广告时间

推荐关注 Edi.Wang 的公众号
lindexi%2F201985113622445

欢迎进入 Eleven 老师组建的 .NET 社区
lindexi%2F20209121930471745.jpg

以上广告全是友情推广,无盈利


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK