Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top