TC 9.1 NuGet pack - nupkg missing dependencies

We are packaging for NuGet from the csproj file ONLY.  The step definition is using NuGet 3.3

When the step is executed, the resultant nupkg's nuspec file contains an empty dependencies node.  If I manually run NuGet pack xxx.csproj then the nupkg's nuspec contains all the dependencies I would expect.

The packages.config is included in the csproj
There is NO nuspec file in the folder

We are using TeamCity Enterprise 9.1 (build 36973)

Step 1: NuGet Installer
Step 2: Visual Studio (sln)
Step 3: NuGet Pack
...

The solution referenced in Steps 1 and 2 contains a single csproj, which is being pack referenced in Step 3.

What is the expected behaviour ?

Cheers

1 comment

Ok, did some more research.. looks like it's an issue with the NuGet pack command.  When I execute this manually a solution file is located in the parent folder is found and NuGet.exe uses the packages folder from there resolve dependencies.

ref: http://nuget.codeplex.com/workitem/3097

In our TC build, the solution file used is in a sibling folder to the folder where the csproj file is.  The reason for this is that the "solution" folder in source control contains many projects, most of which are library projects that are individually packaged.

Each build configuration VCS checkout rules has 3 entries

-:.
+:BuildSolutions
+:ProjectName

So there are NO files in the root folder ( first exclusion ) and the nuget.config is present in the BuildSolutions folder.  The checkout rules are structured this way so as to avoid create X exclusion folders for each project, and because the checkout rule cannot target individual files ( like a specific sln file in the parent for example - hint hint! )

The referenced work item from codeplex indicates 2 "simple" workaround

1. Specify the repositoryPath in

nuget.config

2. Create an empty sln at the right place

Neither work around is directly possible based on our folder structure.

I created a CommandLine task that executes xcopy to "move" the nuget.config file from the build solutions folder into the target csproj's folder.

Any other way I can accomplish this ?  The xcopy feels a little hackish and needed a custom configuration parameter to hold the project folder name
0

Please sign in to leave a comment.