i have the following setting:
The dependencies were missing for me because I didn't have the *.nupkg files in the packages folder for all the packages I was using.
This was pretty hard to track down, because the output of nuget pack looked like it was working:
Found packages.config. Using packages listed as dependencies
I had been using GitHub's Visual Studio .gitignore and only commented out the one line about "Package Restore" (because I wanted to commit my packages), but I should have commented out two. It should look like this:
# NuGet Packages
# *.nupkg
# The packages folder can be ignored because of Package Restore
# **/packages/*
Thanks to Rick Mohr's answer for linking to the CodePlex work item 3097, where feiling explains how the packages folder is used:
Since
packages.configcontains just a list of packages, and does not contain dependency relationship between those packages, nuget needs to access those package files to get the dependency info. That's why it needs to know the packages folder.
The dependency information that feiling refers to is inside the *.nupkg files. Once I changed the .gitignore and committed all the missing *.nupkg files, my TeamCity build server was able to successfully create my NuGet package with the correct dependencies.