11

Maybe I'm doing something wrong or expressing pure ignorance here, but I can't really see how Nuget packages are beneficial? I recently decided to install a number of Nuget packages to replace the static DLLs in my application. When I inspect the folders that are created by the packages they seem to include many different versions of the DLL all nested under an array of sub directories.

Don't all these files, many of which appear to be redundant increase the overall size of the application and slow down the publish and deploy routine? Also which items should be placed into source control?

Like I said I may be missing something here but can anybody enlighten me on the virtues of Nuget packages? I'm starting to think that a simple dll in the bin folder worked perfectly fine?

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
QFDev
  • 8,668
  • 14
  • 58
  • 85

1 Answers1

10
  1. Each package knows what other packages - and specifically what versions thereof - it depends on. That helps to make sure all libraries are compatible.
  2. You still only should deploy that DLL version you actually need
  3. You can decide to not put any DLLs into your source control, because NuGet has a "Package Restore" feature that automatically loads missing packages on build.
  4. You have a central place for all your dependencies: Just right-click on your project and choose the packages you need. No more searching for download links etc.
Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
  • Thanks Daniel, the source control aspect was the bit I struggled with. How do I selectively deploy only the dlls I need. Do I need to go through the package dlls in VS and manually select not to compile? – QFDev Mar 07 '13 at 14:42
  • 3
    @QF_Developer: When Visual Studio builds your project it copies all needed DLLs to the bin folder. That's what you deploy. You will see, that you won't have multiple DLLs of the same package in your bin folder. – Daniel Hilgarth Mar 07 '13 at 15:14