Visual Studio 2015 Preview–Package Manager
One of the changes coming with VS 2015 is how NuGet packages are managed. In VS2013 you got something like this when managing packages for a solution.
This UI provides some useful information.
- What packages are installed and in which projects
- What packages have updates
- What packages are available
In VS2015 you get a completely different UI.
One of the first things to notice is that it is no longer a modal dialog but a regular document window. Getting around in the UI can be a little confusing at first so let’s take a look at how to access all the information we had in previous versions.
Installing packages is done from this single window by either selecting a common package from the left side or by searching from the top. Notice that the configured package sources is at the top now rather than broken up in a tree structure.
Once you have found the package you wish to install you need to ensure the Action on the right side is set to Install (the default). Unlike VS2013 you can also select the specific version to install. With VS2013 if you wanted to install anything other than the latest you had to use the console. Now you can select the appropriate version all within the same UI. Finally you can select the project(s) to install the package into. Currently it shows all projects in the solution and doesn’t provide any way to select or unselect all projects. Additionally the project list is current not ordered so you may need to hunt around in larger projects.
When you are ready to install click the Install button and it will run through the install process. If you’d like to see a preview of the changes then use Preview instead.
One of the new features is how dependencies are installed. It is under Options. Currently the options include getting the lowest or highest version of a package or getting the highest minor version of the dependent package. This is useful when you want to use the latest packages but not necessarily jump to a higher, and possibly incompatible, version. You also have the option of determining what happens if file conflicts occur.
One of the confusing things I ran into when first working with the new UI was how to determine what packages are already installed. This is useful when you’re trying to diagnose issues. To get to the installed package change the Filter combo at the top to Installed. Now you will only see the packages that are installed.
The Action options have changed as well. You can now update to a different version or uninstall the package from one or more projects. As before you have Options if you want to control dependent packages.
While you can select each package under Installed and update them manually this is slow. Instead consider changing Filter to Update Available to get a list of packages that have updates. As before you can then select each package and manage them normally. At this time there does not appear to be any way to update all packages at once. But this is just a preview so hopefully this feature will be added before release. Overall I really like the new package manager.