Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TeamCity CI failing to find NuGet

I'm configuring a TeamCity build server for .Net CI and I can't seem to get NuGet to work correctly.

So far I have done the following:

  • enabled NuGet via the TeamCity administration page
  • Enabled a NuGet build step
  • Validated that the NuGet tab appears correctly on the build page and shows the correct packages

but I continue to get the following error:

C:\TeamCity\buildAgent\work\3bc6f7b8cc834839\.nuget\NuGet.targets(83, 9): Unable to locate 'C:\TeamCity\buildAgent\work\3bc6f7b8cc834839\.nuget\NuGet.exe' 

I'm at a loss as my NuGet build step completes successfully, but my actual solution build does not as a result of it not finding NuGet

What have I missed?

like image 385
Robert H Avatar asked Apr 25 '14 17:04

Robert H


2 Answers

You don't need to include the nuget.exe from the .nuget folder in your source control. If you edit the NuGet.target file the .nuget folder - which you probably did include in your source control, then'll see at about line 15 (so it was here on my machine):

<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>

Change that to :

<!-- Download NuGet.exe if it does not already exist -->
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">true</DownloadNuGetExe>

And voila !

Michael

like image 95
Michael Bruyninckx Avatar answered Oct 04 '22 21:10

Michael Bruyninckx


That path is looking for nuget.exe in you repository's .nuget folder. do you have that included in your source control?

like image 35
Jim Bolla Avatar answered Oct 04 '22 22:10

Jim Bolla