VS中程序包管理器的使用
来源:互联网 发布:域名绑定记录类型 编辑:程序博客网 时间:2024/05/22 01:56
Managing NuGet Packages Using the Dialog
This topic describes how to find, install, remove, and update NuGet packages using theManage NuGet Packages dialog box. To use this dialog box, you must have a solution open in Visual Studio. As an alternative, you can install packages using PowerShell commands. For more information, see Using the Package Manager Console.
Note, for managing packages within multiple projects in the solution at the same time, skip to the section on Managing Packages for the Solution.
Finding a Package
In Solution Explorer, right-click the References node and click Manage NuGet Packages.... (Note, in a Website project, right click on the Bin node.)
Click the Online tab to display the list of available packages.
Browse through the list, or search for a package using the search box at the top right of the dialog box. For example, to find the logging package named ELMAH, enter "elmah" or "logging".
Long lists are divided into pages. Use the paging links at the bottom to move from page to page.
When you select a package, an Install button appears, and a description is shown in the right-hand pane.
Installing a Package
To install a package, select it and then click Install. NuGet installs the selected package and any other packages it is dependent on. Files are copied to the solution, references might be added to the project, the project app.config or web.config file might be updated, etc.
You might be asked to accept license terms.
When the installation completes, the Install button turns into a green check mark to indicate that the package was installed correctly.
In Solution Explorer, you can see references that Visual Studio has added for the installed library or libraries.
If your app.config or web.config file required changes, those have been applied. The following example shows some of the changes for ELMAH.
A new folder named packages is created in your solution folder. (If your project does not have a solution folder, the packages folder is created in the project folder.)
The packages folder contains a subfolder for each installed package. This subfolder contains the files installed by the package. It also contains the package file itself (the .nupkg file, which is a .zip file that contains all of the files included in the package).
You can now use the library in your project. IntelliSense works when you enter code, and library features such as the ELMAH logging information page work when you run the project.
Removing a Package
Open the Manage NuGet Packages dialog and make sure the Installed Packages tab is selected to display the list of installed packages.
Select the package you want to uninstall and then click Uninstall to remove the package.
The following package elements are removed:
- References in the project. In Solution Explorer, you no longer see the library in theReferences folder or the bin folder. (You might have to build the project to see it removed from the bin folder.)
- Files in the solution folder. The folder for the package you removed is deleted from the packages folder. If it is the only package you had installed, the packages folder is also deleted.)
- Any changes that were made to your app.config or web.config file are undone.
If other packages were installed because they were dependencies of the package that you removed, you might want to remove them also.
If a package has dependencies, NuGet prompts offering the choice to remove the package's dependencies.
Updating a Package
Open the Manage NuGet Packages dialog and make sure the Updates tab is selected to display the list of packages that have newer versions available.
If any packages have updates available, they will be listed in the center pane. The following screenshot shows a newer version of jQuery available.
Select the package you want to update and click Update to update the package to the latest version.
If a package includes release notes, they will show up in place of the description in the right pane.
Managing Packages for the Solution
In the previous section, we looked at managing packages for a single project. In NuGet 1.4 and above, the Manage NuGet Packages dialog can also be launched at the solution level in order to install/uninstall packages in multiple projects at the same time.
Just right click on the Solution and select Manage NuGet Packages. You can also launch this dialog from
The dialog looks the same as it does when launched from a project, but notice the title bar indicates that the scope of the dialog is the solution.
The key difference is that each operation lets you select which projects it applies to.
Installing Online Packages
When the Online tab is selected, clicking the Install button allows selecting the set of projects to install the package into.
Managing Installed Packages
When the Installed tab is selected, clicking the Manage button allows toggling whether or not the package is installed for each project.
Updating Packages
When the Updates tab is selected, clicking the Update button allows selecting the set of projects to install the update into.
Package Sources
NuGet can display packages from multiple package sources. To add a package source, click on the Settings button in the dialog to launch the Options dialog. Make sure the Package Sources node is selected in the dialog.
Type in the name of a source as well as its URL or folder path (a folder containing NuGet package files is a valid package source) and then click the Add button.
The package source will be listed under the All node. Click on the package source to view packages from that source. The All node displays an aggregated view of packages from all package sources.
If you want to temporarily disable a package source, just uncheck the package source in the dialog. This is useful if a package source is temporarily down for some reason and you need to keep it from being included in the aggregate feed.
转载自:https://docs.nuget.org/consume/package-manager-dialog
- VS中程序包管理器控制台的使用
- VS中程序包管理器的使用
- VS程序包管理器控制台指令
- asp.net MVC Code First模式在 vs 程序包管理器控制台执行的数据迁移更新语句
- android程序包管理器
- VS 中NuGet 尝试还原程序包时出错"*"已拥有为"**"定义的依赖项
- VS 中NuGet 尝试还原程序包时出错"*"已拥有为"**"定义的依赖项
- VS 中NuGet 尝试还原程序包时出错"*"已拥有为"**"定义的依赖项
- 使用VS配置管理器实现不同版本的输出
- 依赖关系的解决:程序包管理器的前段工具yum
- JAVA中程序包的基本概念
- JAVA中程序包的基本概念
- JMeter 中 HTTP Cookie 管理器的使用
- JMeter中HTTP Cookie管理器的使用
- VS中MFC的使用
- VS中pow的使用
- VS 中 TODO的使用
- VS中dll的使用
- android中解析xml文件的工具类XmlUtils
- Android布局中实现圆角边框
- linux 中网络设备的那些事 bridge TAP Veth Vlan br
- VS2010/MFC Ribbon风格下CDockablePane的使用
- eclipse 安装jetty插件
- VS中程序包管理器的使用
- Calendar JAVA中用来计算时间差, 两个时间差, 多个时间差.
- ASP.Net增删查改写的一个通讯录系统---ShinePans
- linux常用命令
- hdu5261蜀道难 单调队列
- ProgressDialog中的Context注意事项
- BeanUtils
- ScrollView中嵌套的viewPager,viepager高度设置为wrap_content时内容不显示问题以及与scrollview冲突的解决方案
- ffmpeg学习笔记目录