The following is a workaround that may help you, although I had the impression that the NuGet Feed Credentials credential collection feature was designed to fix the problem. I had a similar problem with the TeamCity NuGet internal feed without guest access (in this example it is called Local).
Initial build step (command line - user script)
del /F %env.APPDATA%\NuGet\NuGet.Config
%teamcity.agent.tools.dir%\NuGet.CommandLine.DEFAULT.nupkg\tools\nuget.exe sources add -name Local -source %env.NuGetFeed%
%teamcity.agent.tools.dir%\NuGet.CommandLine.DEFAULT.nupkg\tools\nuget.exe sources update -Name Local -User %env.BuildServiceUser% -pass %env.BuildServicePassword%
As I said, this is a workaround, but not too much to support when using templates. Hope it makes you work.
source
share