Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't nuget include the referenced project when packing?

Tags:

nuget

I have reproduced this issue in the following simple scenario

  • LibB - project
    • ClassB
  • LibA - project
    • ClassA that references ClassB

Now I want to create a nuget package of LibA and run:

nuget pack LibA.csproj

This works fine, but when I check the nuget package I can't find a LibB.dll in the lib folders as I expected. Why not?

I'm using version 2.2 of Nuget.

like image 658
Tomas Jansson Avatar asked Apr 24 '13 11:04

Tomas Jansson


People also ask

Do NuGet packages include dependencies?

Any time a package is installed or reinstalled, which includes being installed as part of a restore process, NuGet also installs any additional packages on which that first package depends. Those immediate dependencies might then also have dependencies on their own, which can continue to an arbitrary depth.

How do I update NuGet package references?

Update a package. In Solution Explorer, right-click either References or the desired project, and select Manage NuGet Packages.... (In web site projects, right-click the Bin folder.) Select the Updates tab to see packages that have available updates from the selected package sources.


1 Answers

NuGet 2.5 now has a -includereferencedprojects option, more details can be found here : NuGet Command-Line Interface (CLI) Reference | Microsoft Docs
I download the latest version of nuget.exe from nuget.org/nuget.exe or by nuget update -self.

like image 120
Deepak Avatar answered Oct 15 '22 19:10

Deepak