Nuget:将多个大型解决方案迁移到 PackageReference

Nuget: Migrating multiple large Solutions to PackageReference(Nuget:将多个大型解决方案迁移到 PackageReference)
本文介绍了Nuget:将多个大型解决方案迁移到 PackageReference的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

背景

我正在处理一个包含多个大型解决方案的大型项目.总而言之,我们有超过 400 个 C# 项目.过去,我们将 Nuget 与 packages.config 文件一起用于我们的依赖项.现在我们要将所有项目迁移到新的 PackageReference 格式.

问题

我知道 Visual Studio 提供了将 single 项目从 packages.config 迁移到 PackageReference 格式的解决方案,但我没有知道我可以一次迁移多个 Visual Studio 解决方案的解决方案.我不需要 Visual Studio 的兼容性检查,因为所有使用的包都与新格式兼容.

问题

有没有一种方便的方法可以一次将多个 Visual Studio 解决方案从 packages.config 迁移到 PackageReference 格式?

解决方案

Nuget:将多个大型解决方案迁移到 PackageReference

为确保迁移的准确性,Visual Studio 和大多数扩展都提供将单个项目从 packages.config 迁移到 PackageReference 格式,并将执行Visual Studio 的兼容性检查.

如果您想一次迁移多个 Visual Studio 解决方案,AFAIK,目前没有这样的方法或扩展.

作为解决方法,我想为您提供一个扩展:

希望这会有所帮助.

Background

I'm working on a big project with multiple large solutions. All in all we have over 400 C#-Projects. In the past we used Nuget with the packages.config file for our dependencies. Now we want to migrate all of the projects to the new PackageReference format.

Problem

I know Visual Studio provides a solution for migrating a single project from packages.config to the PackageReference format, but I'm not aware of a solution where I can migrate multiple Visual Studio Solutions at once. I don't need the compatibility check of Visual Studio, because all used packages are compatible with the new format.

Question

Is there a convenient way of migrating multiple Visual Studio Solutions at once from packages.config to the PackageReference format?

解决方案

Nuget: Migrating multiple large Solutions to PackageReference

To ensure the accuracy of the migration, Visual Studio and most of the extensions are provide migrating a single project from packages.config to the PackageReference format and will perform a compatibility check of Visual Studio.

If you are want to way for of migrating multiple Visual Studio Solutions at once, AFAIK, there is no such method or extension at this moment.

As workaround, I would like provide you a extension:

NuGet PackageReference Updater

Which can migrate a single solution with multiple large projects from packages.config to the PackageReference format at once. Just right-click the Solution in Solution Explorer and click Upgrade to Package References:

Hope this helps.

这篇关于Nuget:将多个大型解决方案迁移到 PackageReference的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)