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.
I did not find the accepted answer much relevant, because the extension link is broken. I did see some repo containing a custom code to migrate, but it just did 1-1 substitution without eliminating the transitive dependencies - not good.
So, I have written my own something to automate the process of applying the built-in migration tool to all the non Asp.Net projects - https://github.com/MarkKharitonov/NuGetPCToPRMigrator
I used it to migrate a couple of hundreds projects across a few solutions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With