Why does NuGet deliver packages at the "solution level"?

When you add a nuget package to a project, it places assemblies in the / packages folder at the solution level.

I know there are ways to change this, but I wonder why this is the default location, as it seems very useless for the following reasons:

1) If you have a project that is part of several solutions, the / packages folder will not necessarily be where you expect it to be.

2) It is expected that you manually check it in the initial control for other team members, which is much less convenient than if it were part of the project that he needs.

3) If you move the project somewhere else on the file system or to another machine that does not have a complete code base, it will not find the / packages folder in which it calculates.

It seems that all of this will be resolved if NuGet just uses the / packages folder inside the project and not the solution. And this seems like a much more logical place to place the packages on which the project basically relies.

So ... I assume that there are / there are good reasons for this at the decision level, and I hope that someone can enlighten me.

+8
nuget nuget-package
source share
2 answers

You should read this, which explains how to use nuget without sending packages to the original control, and by side effect, solve points 1 and 3 of your question: http://blog.davidebbo.com/2011/03/using-nuget -without-committing-packages.html

+4
source share

I think this saves disk space. If you had a big solution with 50 projects, and you used the package in each of them, you would have 50 copies of this package, binary files and all. While storing them at the decision level is much more efficient in this regard.

In terms of version control, you should not put your actual packages folder there. Just add the package.config file and do what David Abbo offers in the blog post mentioned by mathieu , or create a simple batch file to download all of your packages based on the packages.config files that it can find.

It’s not much effort to create your own nuget feed so that you can store your private packages there.

+2
source share

All Articles