Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TeamCity with NuGet, missing references

I'm trying to have my TeamCity server pick up packages from NuGet, so I don't have to include all the assemblies in my repositories.

Initially everything seems to be working, but when the MSBuild step kicks in, the assemblies/packages needed are nowhere to be found.

I've added my packages folder to my repository, and I tried enabling my project to "Enable NuGet package restore" as pointed out here:

http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages

Neither seems to work. When I look at the packages folder in the working directory (), it's empty, so no packages was picked up?

Here are the log from the nuget tasks:

[09:11:44][Step 1/2] install: Installing NuGet packages for ApplicationBoilerplate\packages.config
[09:11:44][install] NuGet command: C:\TeamCity\buildAgent\tools\NuGet.CommandLine.2.0.0.nupkg\tools\NuGet.exe install C:\TeamCity\buildAgent\work\76a8f67cab97e73b\ApplicationBoilerplate\packages.config -OutputDirectory C:\TeamCity\buildAgent\work\76a8f67cab97e73b\packages
[09:11:44][install] Starting: C:\TeamCity\buildAgent\temp\agentTmp\custom_script862718012095619696.cmd
[09:11:44][install] in directory: C:\TeamCity\buildAgent\work\76a8f67cab97e73b\ApplicationBoilerplate
[09:11:45][install] Process exited with code 0

Should the packages folder stay empty (some sort of temporary storage?) or should it contain the downloaded packages?

like image 821
Steen Tøttrup Avatar asked Jul 12 '12 11:07

Steen Tøttrup


1 Answers

As of NuGet 2.0 you need to do more than the docs page describes. Here is a blog about the change.

I wrote a post about enabling package restore using an environment variable: Enable NuGet PackageRestore on CC.NET

Rob Reynolds created a NuGet package that should automagically fix this, but I haven't tried it yet.

NuGet Enable Package Restore (For Real) 2.0.0

If your TeamCity server has no access to the web, then you may have this issue as well:

NuGet package restore assumes internet access

like image 154
Jim Counts Avatar answered Oct 11 '22 12:10

Jim Counts