David Schmitt
David Schmitt

Reputation: 59355

NuGet: automatically migrate references to packages

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.

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

Upvotes: 3

Views: 968

Answers (2)

davidfowl
davidfowl

Reputation: 38824

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.

Upvotes: 2

Matthew M. Osborn
Matthew M. Osborn

Reputation: 4793

The easiest way would be to write a powershell script that looked at your references in the project using DTE (this can be done with the NuGet powershell window) and then looks for a matching package. It's Not a perfect solution but it could work.

Upvotes: 2

Related Questions