2
votes

I have set Up a project in teamcity 8 that requires nuget package restore, and I have also added two build steps, one for the Nuget installer and for MsBuild.

Since we need to connect via a proxy, I have also set this in the Nuget.config file under the config tag using the commandline tool.

However, when I build the project inside teamcity, I am unable to restore the packages. I get the following error: enter image description here

But when I try to run the command directly from the commandline, the nuget packages are restored successfully.

Are there extra settings I need to have in teamcity in order for this to work ? I already added an enviroment variable to enable nuget package restore if that helps.

2
When you run the command line on your Team City build agent, are you logging in under the same account the service runs as? It could be a permissions issue, where the user doesn't have the appropriate permissions to access the proxy.Damon
Yea I noticed that the teamcity server is logged on as Administrator, while the build agent is logged on as 'Local System'.I ran the nuget command as an administratorlacoder

2 Answers

0
votes

You will most likely need a domain account to run the service as.

Have a domain account created, such as "teamcity", and then set the services to run as that user.

Then, you can log in as that user on your build agent and verify that you're able to do what you need to do, adding permissions as needed until you get it to work.

See the TeamCity documentation for more information about the permissions your user will need.

0
votes

I had a similar problem with Nuget restore - and came across this answer here: https://stackoverflow.com/a/21045126

It seems to be similar to your comment made on your original post about running as Local System.

I changed the Local System (log on) for the Agent service to be the user that I use to log onto the server. Once I ran the nuget restore again it worked. You only need to change the Agent service because the agent is the actual "worker" that runs the build steps.