VisualStudio 2013 lists all NuGet packages

I have a mvc 5 web project with a number of NuGet packages installed (e.g. email, log, pagedlist, etc.).

In a new similar project, I would like to install the same NuGet packages. How can I install all installed NuGet packages in the old project list?

+3


source to share


4 answers


  • You can find the file packages.config

    in the root directory of the old project.
  • You can copy it to a new project.
  • If you go to Tools -> NuGet Packet Manager -> Package Manager Settings and check Allow NuGet to download missing packages

    , and in another checkbox that says Automatically check for missing packages during build in Visual Studio

    it will be downloaded for you next time you create it.


+3


source


If you want to list all installed nuget packages for a project take a look at this.

http://blogs.msdn.com/b/david_kidder/archive/2014/08/19/micro-blog-how-to-list-installed-nuget-packages-from-package-manager-console-and-be- able-to-read-them.aspx



You can also enable nuget package restore to restore packages when you rebuild your projects. Here's another link for you - http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html

+2


source


  • Find the file in the root folder of your source project packages.config

    . Copy its contents to a new project, same filename.
  • Go to Visual Studio> Tools> Package Manager Settings> General
  • Enable "Allow Nuget downloads ..." and "Automatically check for missing ..."

Now create a new project

+1


source


Most of the answers here are partially correct.

The first part is correct. The packages.config file lists all the packages that are used in the project.

However, all the answers about using package restore are incorrect. Package Restore will download all missing packages, however NOT the same as installing the package into the project. It won't add links, run any install.ps1 scripts or add files, change .config, etc. Package restore simply downloads missing packages. It is assumed that the packages have already been installed in the project.

To ensure that the packages are installed correctly in the new project, open the Package Manager Console and type:

Update-Package -ProjectName MyProjectName -Reinstall

      

This will force NuGet to start the installation process and install the package correctly into your project.

0


source







All Articles