Nuget dependencies not getting registered in the .nuspec file when built by TeamCity

I have a C# project that gets packaged as a nuget package using the <BuildPackage>true</BuildPackage> element in the csproj file.
When I build it locally, the generated .nupkg file contains a .nuspec file with a <dependencies> element that shows all of the other nuget packages that my project depends on.
When TeamCity builds it, the .nupkg file created has a .nuspec file with no dependencies in it.

Any ideas why this would be?

2 comments
Comment actions Permalink

I realized what the difference is between the two scenarios: in my local tree I have the solution file (at the root of the tree) which contains my project.
The TeamCity checkout rules do not check out this solution file (because that's apparently not supported), and I'm telling TeamCity to build the project directly.
When I build the project directly, manually (either locally or on the TC agent machine) with the solution file present at the root of the tree (work folder), I get the right dependecies generated in the nupkg file.
With the solution file absent, the depdendencies do not get written.

So I don't think this is actually a TeamCity problem (except that I can't work around it easily by just adding a check out rule for the solution file).
My project is a few megabytes, the whole trunk is over a gigabyte...

0
Comment actions Permalink

Hi Wayne,

Here is the related request to support checkout rules for individual files: https://youtrack.jetbrains.com/issue/TW-3460. Please vote for it.

0

Please sign in to leave a comment.