2

I have a pretty simple application with some NuGet references and it works fine locally. I have not committed the packages folder of course, just the config. When I have TeamCity build the solution, I originally got the error that I needed to enable Nuget Package Restore so I did.

Now when I build I get the message

The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568.

Makes sense, but I get this error no matter how many times I build it. It continually fails. Am I missing something here?

KJ3
  • 5,168
  • 4
  • 33
  • 53

1 Answers1

1

Run the NuGet package restore before you build the solution.

Team City should have a NuGet Installer step which will restore the NuGet packages. Add this to your build steps before the compilation of the solution.

You an also do this yourself with a build step which runs:

NuGet.exe restore YourSolution.sln

However Team City's built in NuGet build step allows you to configure other things, such as private NuGet repository urls, easier than creating your own build step from scratch.

Matt Ward
  • 47,057
  • 5
  • 93
  • 94