Installing Nuget Packages globally
Asked Answered
P

2

38

Is there a way to install Nuget Packages globally?

I have a Nuget Package that I would like to use across multiple projects without having to download for each project?

Each project will have its own solution and it will be independent of other project.

Pelorus answered 15/11, 2015 at 1:1 Comment(3)
I'm also looking for an answer to this question. This blog post by the NuGet dev lead from october 2014 lists "Global Package Installation" as one of the open issues. Don't know if it's fixed by now though.Jeromejeromy
I wish there were a way. I experiment a lot and create new solutions every day and have had to re-download everything every time so far. Even in case there is no official way there is to be a tool capable of copying NuGet packages from one solution into another and/or maintaining a cache of them.Mctyre
If the package is a tool, use dotnet tool install -g <package>. For more information, see natemcmaster.com/blog/2018/05/12/dotnet-global-tools.Draw
B
6

NuGet in its current version uses a global package cache.

Have a look at the documentation to find out where it is on your machine. You should also poke around the NuGet configuration file documentation for how to update the global cache location.

Bess answered 8/11, 2017 at 15:34 Comment(0)
V
1

dotnet add package <package-name> adds a package refernece to the project file and checks if it is installed (globally), and if not - installs it.
(you have to be in a project directory)
Install and manage NuGet packages with the dotnet CLI ↗

You can check the locations of packages with dotnet nuget locals all --list
Managing the global packages, cache, and temp folders ↗

Visibility answered 6/4 at 15:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.