I have created a Nuget Server using Teamcity (running on a virtual machine in internet) and created the build that publishes a package into it.
I also have another project that needs to use that package. This project is built on teamcity as well. On my local Visual Studio I added the nuget feed uri, installed the package and everything works fine. But when I try to build it on teamcity it says that "Package not found".
So my question is : "How to add the custom nuget feed to TeamCity build?"
The NuGet package sources are configured through Visual Studio, but they're stored in a per-user configuration file, found at c:\Users\$USER\AppData\Roaming\NuGet\NuGet.config
. The entry for the TeamCity package source needs to be added to the config file of the build agent user that's running your builds.
EDIT: ladenedge documents a good solution that didn't exist when I originally answered this question. The solution is especially useful if you don't have admin access to the build agent or want to configure package sources on a per-project basis.