[英]VisualStudio 2013 list all NuGet packages
I have a mvc 5 web project with a number of NuGet packages installed (like email, log, pagedlist etc). 我有一个mvc 5 web项目,安装了许多NuGet包(如电子邮件,日志,页面列表等)。
In a new similar project I would like to install the same NuGet packages. 在一个新的类似项目中,我想安装相同的NuGet包。 How can I in the old project list all installed NuGet packages?
如何在旧项目列表中安装所有已安装的NuGet包?
packages.config
file in the old project's root directory. packages.config
文件。 Allow NuGet to download missing packages
and the other check box that states Automatically check for missing packages during build in Visual Studio
it will download it for you next time you build. Allow NuGet to download missing packages
,另一个复选框表明Automatically check for missing packages during build in Visual Studio
它将在您下次构建时为您下载。 If you want to list all installed nuget packages for the project take a look at this one. 如果要列出项目的所有已安装的nuget包,请看一下这个。
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 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-能够阅读,them.aspx
You might also want to enable nuget package restore to restore the packages when rebuilding your project/s. 您可能还希望启用nuget包还原以在重建项目时还原包。 Here's another link for you - http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html
这是您的另一个链接 - http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html
packages.config
file. packages.config
文件。 Copy its contents to your new project, same file name. Now build your new project 现在建立你的新项目
Most of the answers here are partially correct. 这里的大部分答案都是部分正确的。
The first part is true. 第一部分是真的。 The packages.config file lists all packages that are used by the project.
packages.config文件列出了项目使用的所有包。
However, all the answers about using Package Restore are incorrect. 但是,有关使用程序包还原的所有答案都不正确。 Package Restore will download any missing packages, however it is NOT the same as installing a package into a project.
包还原将下载任何缺少的包,但它是不一样的安装包到项目。 It will not add references, run any install.ps1 scripts, or add files, modify .config, etc. Package Restore simply downloads missing packages.
它不会添加引用,运行任何install.ps1脚本,或添加文件,修改.config等.Package Restore只会下载丢失的包。 It is assumed that the packages were already installed to the project.
假设包已经安装到项目中。
In order for the packages to be correctly installed in your new project, open the Package Manager console, then type: 要在新项目中正确安装软件包,请打开软件包管理器控制台,然后键入:
Update-Package -ProjectName MyProjectName -Reinstall
This will force NuGet to run through the install process and correctly install the package into your project. 这将迫使NuGet运行安装过程并正确地将软件包安装到您的项目中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.