2

I'm actually thinking about the pro and cons about using NuGet. In our current software we're storing each external reference in a common reference folder (which is commited to our SW versioning system). Over time this approach becomes more and more painful because we've to store different versions to the same library.

Since our devs are sometimes at the customer site (where not all customers are offering internet connectivity ...) we won't use NuGet directly, because NuGet packages can't be restored.

Based on that I'm actually thinking about using NuGet and store the packages folder in our SW versioning system.

Does anybody know if there are some disadvantages about this solution? Does anybody have a better proposal?

Thx.

1 Answer 1

3

I would argue against storing external nuget packages in your version control system.

  1. It's not your application's responsibility to archive third party packages. Should you need to take care of that risk then build a solution intended for such (for example: use private nuget repository that's properly backed up).
  2. Avoid duplication in code base - provided you use properly released packages, then the packages.config file content is sufficient for reliably reproducing the exact dependencies your application needs.
  3. Synchronization is an effort - keeping packages.config and packages folder in sync- once you start including them in source control every developer working with packages would monitor and add or remove packages to source control.
    1. If devs ever forget to add then local build still fails.
    2. If they forget to remove no longer necessary piece then your downloadable set would contain junk.
  4. VCS dataset size - storing them would needlessly enlarge your version control storage. Quite often the packages contain N different platform dlls, tools and whatnot which add up quite fast. Should you keep your dependencies constantly up to date, then after 10 years your VCS history would contain huige amount of irrelevant junk. Storage is cheap, but still..

Instead, consider having a private nuget repository with the purpose of serving and archiving the packages your application needs and set up your project to check your project nuget repository first. If your developers need offline compile support then they can set up project repository mirrors on their build boxes and configure the following fallback structure for repos:

  1. Developer local project repository (ex: folder)
  2. Shared project repository (ex: Nuget.Server)
  3. (nuget.org)

A guide how to configure multiple repositories can be found here: How to configure local Nuget Repository.

Not the answer you're looking for? Browse other questions tagged or ask your own question.