18

I have created a TeamCity buils step using Nuget Installer, but when I run the steps I get the error :

Updating sources: server side checkout
[15:35:44][Updating sources] Repository sources transferred: 112.73 KB total
[15:35:44][Updating sources] Removing C:\TeamCity\buildAgent\work\12dee9c66185ea67
[15:35:44][Updating sources] Updating C:\TeamCity\buildAgent\work\12dee9c66185ea67
[15:35:44]Parameter **"teamcity.tool.NuGet.CommandLine.DEFAULT=%teamcity.tool.NuGet.CommandLine.3.4.3%" is not fully resolved, using as is.**

Step 1/3: Nuget (NuGet Installer)
[15:25:34][Step 1/3] scan: Searching for nuget.config files
[15:25:34][scan] Found packages folder: C:\TeamCity\buildAgent\work\12dee9c66185ea67\packages
[15:25:34][scan] Failed to find repositories.config at C:\TeamCity\buildAgent\work\12dee9c66185ea67\packages\repositories.config
[15:25:34][scan] Scanning projects in solution file: C:\TeamCity\buildAgent\work\12dee9c66185ea67\Specflow.sln
[15:25:34][scan] Found project C:\TeamCity\buildAgent\work\12dee9c66185ea67\Specflow\Specflow.csproj
**[15:25:34][Step 1/3] Failed to find NuGet executable at: C:\TeamCity\buildAgent\work\12dee9c66185ea67\%teamcity.tool.NuGet.CommandLine.DEFAULT%
[15:25:34][Step 1/3] Step Nuget (NuGet Installer) failed with unexpected error**

But I have downloaded the Nuget.exe below are the screenshots: enter image description here

Not sure what am I missing? Any help is much appreciated! Thank you.

UNG
  • 673
  • 1
  • 6
  • 17

1 Answers1

40

So after breaking my head over this, I managed to find the solution.

At the time of downloading nuget.exe in Teamcity - Administrator>Integration>Tools>Nuget.exe>Installed Version>3.4.3

if teamcity agent is already running & you try to run a new build, the agent can never detect new installations(in this case nuget.exe) and so it fails.

Solution - restart the agent ->in command prompt C:\TeamCity\buildAgent\bin>agent.bat stop force and then C:\TeamCity\buildAgent\bin>agent.bat start.

Now go to Administration>>Project_name>Build Steps>Parameters

  • Add a new Parameter
  • Configuration Parameters
  • Name : teamcity.tool.NuGet.CommandLine.DEFAULT
  • Value: Browse the small box and select- %teamcity.tool.NuGet.CommandLine.3.4.3%
  • Save

Run the Build

The Nuget Installer Step runs fine and restores the packages.

UNG
  • 673
  • 1
  • 6
  • 17
  • 2
    You can accept your own answer as the accepted one. – notAChance Oct 12 '17 at 10:01
  • 7
    Restarting agent was sufficient for me. – Rémy Esmery Oct 31 '18 at 17:08
  • Agent restart didn't help me, but I was able to work around the issue by adding this build configuration parameter: system.command.line.run.interpreter=false – tolache Apr 12 '19 at 09:53
  • We had one of our build agents showing "Incompatible runner: NuGet Installer" for most build definitions that were based on a template that was just upgraded to use the latest Nuget version. We restarted that build agent and it cleared up. I believe the agents will download any missing tools/updates from the TC host/server whenever they start up, which is why the restart works. – ryancdotnet Jan 12 '21 at 21:01