TeamCity NuGet update does not restore packages correctly

I am trying to get teamcity to update the nuget packages used in one build to the produced packages in a previous build. I have a finished build trigger and have the NuGet installer set to update the packages. This all seem to work ok and I can see from the log that things are being updated. If I then open the .packages file and the .csproj I can see that the updates have happened correctly. However when the build step happens it fails as it can't find the correct files. When I look at the pacakges folder for the updated version I see this structure:


but for the old version I see this structure:


this obviously explains the reason why the files can't be found as it doesn't seem to be installing the nuget package correctly, only putting the nupkg in the folder and not actually extracting it.

Is there some magic I need to know to get this to work?

I have tried using 2 NuGet restore build steps, one which does the rewstore and the update and another which just does the install after the update has happened, but it doesn't seem to make any difference.

We are using  TeamCity Enterprise 7.1 (build 23907)

1 comment
Comment actions Permalink

I've worked around the issue by adding a command line step after the first update nuget package which just does this:

rd packages /S /Q

then having another nuget restore after this step.  this works and the packages are restored corectly, but this seems like a pain and I'd prefer not to have to do this.


Please sign in to leave a comment.