Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

I know that there are ways to change this, but I'm wondering why this is the default location, as it seems very unhelpful for these reasons:

1) If you have a project that is part of multiple solutions, the /packages folder won't necessarily be where you the project expects it.

2) You are expected to manually check it into source control for other team members, which is much less convenient than if it was part of the project that needs it.

3) If you move the project somewhere else on the file system or to a different machine that doesn't have the full code base, it won't find the /packages folder where it expects to.

It seems all of these would be resolved if NuGet just used a /packages folder inside the project, not the solution. And that seems like a much more logical place to put packages that the project relies on anyway.

So... I'm assuming that there were/are some good reasons for doing it at the solution level, and I'm hoping someone can enlighten me.

like image 670
chrismay Avatar asked Jul 19 '11 14:07

chrismay


1 Answers

You should have a read at this, that explains how to use nuget without commiting packages to your source 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

like image 54
mathieu Avatar answered Oct 10 '22 00:10

mathieu