自动将引用迁移到包

自动将引用迁移到包

本文介绍了NuGet:自动将引用迁移到包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个中等规模的解决方案,其中包含约50个项目,其中许多项目引用了nuget提供的多个程序集.我真的很喜欢nuget的想法,并且想切换,但是我想避免不得不手动重新进行所有引用.

I've got a medium sized solution with ~50 projects and many of those projects reference multiple assemblies available from nuget. I really like the idea of nuget and would like to switch, but I'd like to avoid having to re-do all the references manually.

是否可以自动将手动引用升级为解决方案中所有项目的nuget引用?

Is there a way to automatically "upgrade" manual references to nuget references over all projects in a solution?

推荐答案

您必须从nuget.org下拉包(不仅是元数据,还包括元数据和文件),并创建从所有程序集到文件的反向映射.包含那些程序集的软件包.然后,您可以列出潜在的候选软件包列表(可能有一些重叠).一旦找到该列表,就如同安装它们一样简单.

You'd have to pull down the packages (not just metadata but metadata and files) from nuget.org and create a reverse mapping from all of the assemblies to packages that contained those assemblies. Then you could come up with a list of potential candidates for packages (there could be some overlap). Once you came up with that list it's as simple as installing them.

我们实际上为此提交了一个错误,但现在在优先级列表中还不是很高.

We actually filed a bug for this but it's not very high on the list of priorities right now.

这篇关于NuGet:自动将引用迁移到包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 05:45