I want to create and distribute a NuGet package that when installed only installs solution-wide to the root packages
-folder, referencing the package in the .NuGet\packages.config
file.
I have found some information on the NuGet package format in regards to this topic already and according to NuGet FAQ this should be possible if one follow these guidelines:
What is the difference between a project-level package and a solution-level package?
A solution-level package has to be installed only once in a solution to be available for all projects in the solution. A project-level package must be installed separately in each project where you want to use it. For solution-level packages, NuGet doesn't change anything in a project, whereas in a project-level package it does. Typically, a solution-level package installs new commands that can be called from within the Package Manager Console window.
Another Suggested SO solution states that the above should have worked too.
Thing is, I can't get it this to work. I have verified that my package has no lib or content directories:
I have put all the files to distribute in the tools
-folder in the package, including the init.ps1` script top run on install.
I am using Visual Studio 2015 and when I want to install the package:
:/
init.ps1
script does run and executes the commands as I want them to do. :)
packages
-folder is created in the project that I was forced to choose to get the installation done. I would have expected the packages
-folder to be created in the solution-root. :(
packages.config
file is created in the project-folder and not in .NuGet\packages.config
, as I'd expect after reading the docs I have found on this. :(
Any suggestions on how to get this working? Is this a VS 2015 limitation or a NuGet 3 change (as I believe it was included in VS2015)?
The NuGet team deprecated solution level packages in NuGet 3.0.
There is a discussion about bringing them back in a way that is compatible with Visual Studio 2013 for a future version of NuGet.