Problems getting correct version numbers for direct and indirect package dependencies

Topics: General
Dec 5, 2012 at 12:20 AM

When I run the pack command on one of my projects, the resulting package doesn't contain all the dependencies I'd expect it to.

Here's an example:


  • TopLevelProject has a dependency on LibraryA >=
  • TopLevelProject has a dependency on LibraryB >=
  • LibraryA. has a dependency on LibraryB >=

So TopLevelProject has two dependencies on LibraryB; directly on v2.0.0.0 and then indirectly on v1.0.0.0 (via LibraryA)

If you run the pack command on TopLevelProject .csproj, the resulting package will only have one dependency, and that's on LibraryA.

It's missing the direct dependency on LibraryB.

How do you ensure that the correct dependency for LibraryB. is added?

Dec 12, 2012 at 1:51 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Dec 12, 2012 at 1:54 AM

Hello afdavis,

You could go through the intermediate step of creating a .nuspec file and adding the additional dependency yourself before creating the package, but this is more work than shhould be strictly neccessary.  I've created a workitem for this issue, and hopefully it'll be addressed in a future NuGet release.