Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between a dll and nuget package?

Tags:

c#

First of all, I apologize if this is a basic question. I tried looking this up, but for some reason, I got more confused. So, I decided to ask here. Is a dll file and a nuget package the same? Are they both just being referenced in the project?

like image 508
Samson Bujju Avatar asked Jul 17 '14 03:07

Samson Bujju


People also ask

Are NuGet packages DLL?

Put simply, a NuGet package is a single ZIP file with the . nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number.

Is a DLL a package?

A dynamic-link library (DLL) file contains a shared library of functions that can be used by Windows programs. The DLL package uses a . dll file as reference and calls functions from the bot.

How do I get NuGet package DLL?

Just build the class library by clicking the right click on solution explorer and you will see the NameOfLibrary. dll file in packages folder of your project directory. packages folder isn't displaying as folder in solution explorer. You can see them as References.

What is a NuGet package and what is it used for?

NuGet is a package manager that delivers compiled source code (DLLs) and other files (scripts and images) related to code. A NuGet package takes the form of a zip file with the extension . nupkg. This makes adding, updating, and removing libraries easy in Visual Studio applications.


1 Answers

When you add features to your project via a nuget package, you're just adding files to your project. It can be javascript files (like jQuery), DLLs that your project references (like Newtonsoft JSON), or a whole bunch of things (like Entity Framework or Owin/SignalR) -- anything really.

The advantage of using the nuget package system is that it tracks it all for you. It notifies you if your added packages received an update, it removes the files and unreferences them if you take the package off your project. It handles all of that for you, so you don't have to track the files that the nuget package added, place them in special folders, make sure they get copied in your builds, all that micromanaging stuff.

like image 146
Jason Avatar answered Sep 19 '22 01:09

Jason