TeamCity with NuGet, missing references
Asked Answered
F

1

7

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?

Fagin answered 12/7, 2012 at 11:18 Comment(2)
Let me just add, downloading the project from the repository and compiling it in Visual Studio works like a charm, the required packages are downloaded into the packages folder.Irma
Does this command line works on TeamCity Server? Take a look at ASP.NET Web Stack project. They integrated it by default: aspnetwebstack.codeplex.com/SourceControl/changeset/view/…Illegitimate
B
4

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

Bullish answered 12/7, 2012 at 12:28 Comment(4)
Thank you for trying to help me out, I've just read the post about the change, and I was already allowing for NuGet to download packages automatically. I tried out your trick for CC, no luck, and the package you linked to fails on my setup (for some reason).Irma
Do you still get the same exit code 0? Does the server have access to the internet, there's another issue with internet access.Bullish
And the whole bootstrapper thingy has been reverted as pointed out here: nuget.codeplex.com/workitem/2390. As to where the packages go: the nuget.exe install uses the "-o" switch to point to the installation folder. That's where your packages will end up if found. If not found, make sure the nuget.targets file (added by pkg restore) is pointing to your package sources (<PackageSources> element).Altheaalthee
The server has internet access, no problems with that. I've just checked the paths from the log snippet I posted, and they're good. I'll take a look at the nuget.targets file, not sure I understand the content.Irma

© 2022 - 2024 — McMap. All rights reserved.