NuGet VS Design - versionless packages/exclude from TFS/direct and transitive dependencies

Topics: General
Aug 16, 2012 at 12:20 PM

I'd like to open up this discussion with regards to the design of the VS Package Manager and like to explore possibility of including installation options (such as ExcludeVersion and IncludeDependencies) that's present in the commandline and powershell into the VS Package Manager.

Our company's workflow tries to employ a CI build process where packages (mainly internal) are required to be updated, therefore the typical VS Package Manager behaviour where packages are installed with versioned directories and are checked-in to TFS doesn't really work. 

Related posts/discussions:

Our previous workflow was to initially install a package via the Package Manager and edit csproj hintpaths to reflect the versionless packages and remove the package directories from TFS source control. This grew to be quite error-prone, so I decided to give it a go to try and implement the behaviour into the VS Package Manager.

Then came the discussion regarding direct and transitive dependencies where in a large corporation, there is a large dependency tree and default Package Manager behaviour installs package and all dependencies. So I tried to add a global and per session flag which toggles on/off installation of dependencies.

Aug 25, 2012 at 2:58 AM

In summary, the changes here seem to align the VS Package Manager interface to the functionality provided in some of the other NuGet clients (powershell and command line).  Main points:

  1. Adds ability to choose whether the VS Package Manager uses versioned package directories/hint paths.  Lots of discussion on this, but there is no consistent approach across the NuGet clients, so it would be good to have this available in all clients/entry points.
  2. Ability to choose whether a full transitive runtime package closure is added when a package reference is added, or just the package reference itself.  Basically, the default behaviour when you add a package is that all its dependencies and their dependencies are also added as direct references to the project.  This can be REALLY messy with big dependency trees.  This feature just allows you to choose to have the default behaviour, or just add the package reference.  When would you use this?  Well, when you are building a project that is just a dll output (ie it does not need to run directly) you will only need to compile against dependencies, you will not need all transitive code paths to be available in the output directory.
  3. Toggle whether you want installed packages added to source control when running TFS (this is a serious headache for us).

So, a bit of work has gone into this, and there is a pull request that has already been turned down due to lack of discussion.  So, anyone care to chime in and let us know if these changes make sense?  If there are any tweaks to them that would make them acceptable to include into the main NuGet codebase?

May 22, 2014 at 8:45 AM
I fully agree that versionless packages should be supported from within the VS Package manager, since I do not like the way that powershell forces updates to project files every time you update a library to a new version.

The problem is not so much of an issue when you work with 3rd party libraries, but when you use nuget interally in a company to publish libraries and work in feature branches, and need to test your version of the library, then its a mess that the project file is updated, since it complicates mergin back into the main branch, in case you do not want the feature branch's version of the library propagated to the main branch. Version-less packages makes this less painful, since the project file does not have to be updated, and you could just update the package in the feature branch's package repository.