Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a solution-level NuGet package?

Tags:

nuget

How do I create a solution-level NuGet package. That is, one that does not touch any projects, and is listed in .nuget\packages.config (not in any project-level packages.config files).

For example, psake and RavenDB.Server are solution-level NuGet packages.

I can't find anything in the docs for .nuspec files or nuget.exe that says anything about solution-level packages. I can't find anything special in the build processes of those two projects when they call nuget pack. In fact, I can't find a single search result at all about creating solution-level packages.

like image 662
jtbennett Avatar asked Dec 20 '12 23:12

jtbennett


People also ask

How do I manage NuGet packages for my solution?

A good rule of thumb that addresses both of these issues is to always manage packages at the solution level. Right-click on the Solution node in the Solution Explorer and select Manage NuGet packages for Solution.

How do I create a nupkg file in NuGet?

nuget.exe pack -IncludeReferencedProjects -properties Configuration=Release Using these options, Nuget will create a.nupkg that includes any referenced packages and projects. The package filename is automatically created, using the format [package id]. [package version].nupkg

What is a global NuGet config?

A global NuGetDefaults.Config file also specifically configures package sources. Settings apply to all commands issued in the CLI, the Package Manager Console, and the Package Manager UI. Config file locations and uses Notes for earlier versions of NuGet:

How do I import NuGet packages into Visual Studio?

1) Copy your nuget packages into the new folder you created. 2) Open Visual Studio, and click Tools | Nuget Package Manager | Package Manager Settings. 3) Click Package Sources. 4) Add your newly created folder - you MUST fully qualify the path.


1 Answers

I found a brief comment from Phil Haack. It's from an issue on CodePlex:

We already support this. Just don't put any content in the /Content folder nor in the /Lib folder. If your package only has contents in the /Tools folder, the package will not get installed in the project.

Haven't had a chance to test this out, but it sounds like what you're looking for. A quick peek into the RavenDB.Server package (rename .nupkg to .zip) reveals a setup that is consistent with what Phil said in his comment. No content folder, no lib folder. Lots of files. The files are not in a /tools folder, so I think it's safe to presume that's not a requirement.

like image 99
John Nelson Avatar answered Oct 08 '22 03:10

John Nelson