Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between "Managing Nuget Packages" at the solution level in Visual Studio 2019 vs at the Project level?

I currently have a Nuget Package (MediatR) at the Solution Level (via Manage Nuget Packages for Solution). I have a project that needs that package. Do I need to install it also at the Project level? When do you manage them at the Solution level vs. Project level?

like image 955
Mike Lenart Avatar asked Mar 12 '20 19:03

Mike Lenart


People also ask

Where is manage NuGet packages for solution?

Manage packages for the solution Select a solution in Solution Manager, and then select Tools > NuGet Package Manager > Manage NuGet Packages for Solution. In the Manage NuGet Packages for Solution window, select the projects that are affected by the operations.

What is NuGet package manager and how does it work?

NuGet provides the tools developers need for creating, publishing, and consuming packages. Most importantly, NuGet maintains a reference list of packages used in a project and the ability to restore and update those packages from that list.

How do I manage packages in Visual Studio?

In Visual Studio, right-click on your project in the Solution Explorer, and then select Manage NuGet Packages.... Select Browse, and then select your feed from the Package source dropdown menu. Use the search bar to look for packages from your feed.

What is the package manager used in Visual Studio?

The Package Manager Console in Visual Studio uses PowerShell commands to interact with NuGet packages. You can use the console when there's no way to do an operation through the Package Manager UI. You can also use dotnet CLI or NuGet CLI commands in the console.


1 Answers

The "Manage NuGet Packages for Solution" shows an aggregate of all the projects. When installing a package, you must still select which projects to install them in.

It provides a convenient location to automatically update or install packages across multiple projects.

When you manage packages for a single project you get a project-only view.

How packages are installed is no different between the two options.

like image 187
jessehouwing Avatar answered Sep 20 '22 12:09

jessehouwing