Posted in

.NET 升级助手引入第三方 API 和包映射支持_AI阅读总结 — 包阅AI

包阅导读总结

1.

关键词:.NET Upgrade Assistant、Third-Party API、Package Map、Upgrade Process、Microsoft

2.

总结:.NET Upgrade Assistant 上月更新,引入第三方 API 和包映射支持,以简化升级流程,帮助开发者解决平台转换和升级到最新.NET 版本时的难题,还介绍了创建映射和提交请求的步骤。

3.

-.NET Upgrade Assistant 上月更新

– 引入 Third-Party API 和 Package Map 支持

– 目的是简化升级流程,便于平台转换

– 如从 UWP 到 WinUI 或从 Xamarin Forms 到.NET MAUI

– 帮助解决升级难题

– 定位第三方库的等效 API 和 NuGet 包困难

– 现包括微软自有库的映射,也支持第三方的

– 创建第三方 API 映射步骤

– 阅读 upgrade-assistant GitHub 仓库的 README.md

– 克隆仓库,在 Visual Studio 中操作

– 按要求添加文件和创建 NuGet 包

– 鼓励提交请求

– 验证新映射有效后提交

– 合并后会创建并发布新的包

– 扩展包含针对 Xamarin.Forms 到.NET MAUI 升级的 C 分析器和代码修复器

思维导图:

文章地址:https://www.infoq.com/news/2024/07/dotnet-upgrade-assistant-updates/?utm_campaign=infoq_content&utm_source=infoq&utm_medium=feed&utm_term=global

文章来源:infoq.com

作者:Almir Vuk

发布时间:2024/7/5 0:00

语言:英文

总字数:458字

预计阅读时间:2分钟

评分:85分

标签:.NET 升级助手,更新,开发,.NET,.NET 标准


以下为原文内容

本内容来源于用户推荐转载,旨在分享知识与观点,如有侵权请联系删除 联系邮箱 media@ilingban.com

.NET Upgrade Assistant tool received an update last month introducing Third-Party API and Package Map Support to simplify the upgrade process by identifying and replacing outdated third-party APIs and packages with their updated versions. Microsoft states that the new feature aims to ease transitions between platforms, such as from UWP to WinUI or from Xamarin Forms to .NET MAUI.

Furthermore, Microsoft aims to help developers upgrade older applications to the latest version of .NET, which often presents the challenge of locating equivalent APIs and NuGet packages from third-party libraries, noting that the task becomes even more complex when migrating to a new platform.

To address these complexities, the .NET Upgrade Assistant now includes a set of mappings for Microsoft-owned libraries. Notably, this tool now also supports third-party API and package maps, enabling third-party developers to specify mappings for their libraries. These mappings detail the old and new APIs and packages, allowing the Upgrade Assistant to apply necessary code and project changes during an upgrade for developers.

As stated in the original announcement post, to create third-party API maps for the .NET Upgrade Assistant, developers should start by reading the README.md in the upgrade-assistant GitHub repository. They should then clone the repository and open UpgradeAssistant.Extensions.sln in Visual Studio.

Next, they need to create a new folder for their company with a subfolder for their library under mappings in the UpgradeAssistant.Mappings project. Following this, developers should add *.apimap.json and *.packagemap.json files for their library, using the samples or any existing maps as a starting point. Finally, the NuGet package for the maps can be created by running the Pack command in Visual Studio.

(Usage of Pack command in Visual Studio, Source: Microsoft Official DevBlog)

The original announcement post documents the steps to test API and Package Maps, so interested readers can explore more about it.

Furthermore, developers are encouraged to submit a pull request to the upgrade-assistant GitHub repository, Marco Goertz, states the following:

Once you have validated that your new mappings work as expected we encourage you to create a pull request in the upgrade-assistant github repo. We will review your changes, and once they are merged the CI/CD pipeline will create a new Microsoft.UpgradeAssistant.Mappings package and publish it on nuget.org. As soon as it’s published, existing .NET Upgrade Assistant installation will include the new mappings during upgrades.

Additionally, the .NET Upgrade Assistant extension includes a C# analyzer and code fixer specifically for Xamarin.Forms to .NET MAUI upgrades. This tool assists users in manually upgrading code by identifying Xamarin.Forms namespaces and apply necessary code changes based on both built-in and new third-party API mappings.

(Map code fixes,Source: Microsoft Official DevBlog)

Interested readers can find more info and details about .NET Upgrade Assistant on the official Microsoftdotnetwebsite.