16

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.

Tomas Jansson
  • 22,767
  • 13
  • 83
  • 137

1 Answers1

13

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.

shA.t
  • 16,580
  • 5
  • 54
  • 111
Deepak
  • 2,223
  • 17
  • 15
  • 2
    what if the referenced is a dll itself? It doesn't seem to include the dependent DLL. – liang May 15 '15 at 18:24
  • 2
    I'm also having a trouble with this. The option does add project references to the nuget package, but not references to pre-compiled DLLs. Anyone have any idea how to fix this? – TheJoe Sep 18 '15 at 17:16
  • 1
    Did anyone figure this out? – Philip Atz Dec 14 '15 at 17:27
  • 1
    @PhilipAtz I've created a utility, that deals with the problem at a different level: https://github.com/dittodhole/powershell-nuget-packager –  Feb 18 '16 at 21:42
  • I can't get this to work at all. https://github.com/NuGet/Home/issues/5720 – TheJeff Aug 08 '17 at 15:56