Calanus
Calanus

Reputation: 26277

Why use NuGet over installing libraries directly on my machine

I don't get it - can someone please explain to me why I should use NuGet rather than installing a bunch of libraries via a setup.exe or MSI? What advantage is there?

For example is it better to install Entity Framework 4.3 via NuGet rather than downloading the setup? Also, if I install entity framework via NuGet then is it available to any new solutions or projects that I create (bit confused here).

Basically what does NuGet do that a normal install doesn't do (or vice versa!)

Upvotes: 43

Views: 17931

Answers (4)

Valery Gavrilov
Valery Gavrilov

Reputation: 194

Nuget contributes to creating a DLL hell and makes the solution go out of control very quickly, especially when different versions of so called "packages" come into play. Apart from assembly versioning, there are now nuget package versions. Nuget is just adding another wrapper over DLLs and does nothing that would make developers' life easier.

Upvotes: 8

Kiliman
Kiliman

Reputation: 20312

Besides making it simple to add a package to your project, I think NuGet's biggest advantage is dependency management.

NuGet allows project owners to package their libraries as packages. Before, if they depended on other libraries like log4net, they would include those assemblies in their setup/zip file and upload to their web site.

With NuGet, they simply add a reference to these external packages in the .nuspec file. When NuGet installs the package, it will see that there are dependencies and will automatically download and install those packages as well. It also supports conflict management so that if 2 packages depends on different versions, it will figure out the correct one to install.

I think the best way to determine if NuGet will work for you is to actually try using it. I'm sure that once you do, you'll realize that it has many benefits.

Upvotes: 35

user484189
user484189

Reputation: 191

What advantage is there?

Nuget simplifies third libraries incorporation : With a single command line (Install-Package EntityFramework) you make your package available for your project. Instead of googling-find the package-download-setup-reference the package in your project...

Auto-Update is not mandatory, Nuget configuration file let you specify the version, or the range of version, that your application is compatible with.

Also, if I install entity framework via Nuget then is it available to any new solutions or projects that I create

Once you installed a package, dlls are copied in a directory at solution level, you can then reference them from there in others projects of your solution.

For each new solutions, re-installing packages is a better solution. As it is very easy with nuget, it won't be a problem.

Upvotes: 16

Jon
Jon

Reputation: 437366

Nuget provides several additional benefits:

  • it automatically configures your projects by adding references to the necessary assemblies, creating and adding project files (e.g. configuration), etc.
  • it provides package updates
  • it does all of this very conveniently

Upvotes: 20

Related Questions