Managing NuGet Packages Using the Dialog
来源:互联网 发布:甩狗头的软件 编辑:程序博客网 时间:2024/06/05 05:12
转载于 http://docs.nuget.org/docs/start-here/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, seeUsing the Package Manager Console.
Note, for managing packages within multiple projects in the solution at the same time, skip to the section onManaging Packages for the Solution.
Finding a Package
In Solution Explorer, right-click the References node and clickManage NuGet Packages.... (Note, in a Website project, right click on theBin 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.
Package Sources
NuGet can display packages from multiple package sources. To add a package source, click on theSettings button in the dialog to launch the Options dialog. Make sure thePackage 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 theAdd button.
The package source will be listed under the All node. Click on the package source to view packages from that source. TheAll 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.
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 projectapp.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, thepackages 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 thebin folder.)
- Files in the solution folder. The folder for the package you removed is deleted from thepackages 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, theManage 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.
- Managing NuGet Packages Using the Dialog
- Managing Packages Using the Package Manager Console
- Using conda » Managing packages
- Using the WixUI dialog library
- Using Flashback Drop and Managing the Recycle Bin
- Oracle Using Flashback Drop and Managing the Recycle Bin
- Gentoo - Using Masked Packages
- Finding and Installing a NuGet Package Using the Package Manager Console
- Finding and Installing a NuGet Package Using the Package Manager Console
- Managing the Undo Tablespace
- Managing the Keyboard
- Managing the Keyboard
- Managing the Activity Lifecycle
- Managing the Activity Lifecycle
- Managing the System UI
- Managing the Activity Lifecycle
- Managing the System UI -
- Managing the server
- OpenGL使用混合来实现半透明效果
- hdu 2191 (多重背包)悼念512汶川大地震遇难同胞——珍惜现在,感恩生活
- kindeditor批量上传中无法获取session
- Android中防止Toast重复弹出相同的信息
- 读取properties文件的工具类
- Managing NuGet Packages Using the Dialog
- Extjs日期的定义及使用
- 命令行式下java package的编译与运行
- multitable insert command
- 为什么后缀++只能作右值
- Android编程14个很有用的代码片段
- Java GC(垃圾回收)
- android color
- 黑马程序员_Java基础知识