4
votes

I'm trying to configure TeamCity to work with NuGet. So far - no luck. I configured 4 build steps:

  • Download NuGet packages
  • Build
  • Run unit-tests
  • Check for code duplications.

However, when I trigger the build, I can't even get past first build step. I configured TC to download missing NuGet packages. When I run the build, TC says:

Failed to find repositories.config at {here_is_my_path}".

I understand that the problem is I use this VS feature called Enable NuGet package restore - so, there is no such file as repositories.config in my solution folder and that's why TC can't find it and build is failing. So, how am I supposed to configure TC then? Any ideas and help is appreciated.

I'm using .NET 4.0, VS2010 and TeamCity 7 if it helps.

2

2 Answers

6
votes

I got it working by including \packages\repositories.config in my Git repository and using NuGet Install step to update the packages, and an MsBuild step pointed at my .sln file. To get Git to actually pick up the config file without also adding all of the other stuff I added the following to .gitignore:

packages/*
!repositories.config
1
votes

I found out that TeamCity team didn't envision such situation, so someone requested this as a feature almost 4 weeks ago. I voted up, let's see if it can make it to one of the upcoming releases.
For anyone interested here's YouTrack issue link: http://youtrack.jetbrains.com/issue/TW-20525