15
votes

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.

1

1 Answers

13
votes

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.