Reputation: 620
I have a mobile app app_Old and app_New I have restructured the old into the new, now I want all the packages installed in the app_Old to be installed on app_New. I don't want to manually install it by copying the name and installing nuggets package one after the other. How can I achieve this?
Upvotes: 2
Views: 320
Reputation: 2036
First, I am going to question the wisdom of this proposal. Generally speaking, blindly reinstalling all packages in a new project seems like a great way to replicate / create bloat for libraries you may not be using. NuGet Packages should be installed on an AS NEEDED basis especially for a mobile solution where perhaps space is more restrictive. Often you will be adding libraries which are deployed with your project and cause unnecessary bloat if these are not used. The fact that you have "over 50" on your old project, makes me wonder if there are unneeded packages.
However, there are are a few ways you can do this faster. You could edit your project files manually adding / copying and pasting references and then restoring the packages. The other way is to make a script you can run against the project. You may be able to more quickly do this than point and click re-installing and waiting. Start here for the NuGet Command Line Reference (CLI): https://learn.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference
Furthermore, keep in mind that just because you have "over 50" nugets installed, doesn't mean you have to install 50. Many of these may get automatically installed as dependencies of other packages.
Upvotes: 3