TeamCity CI未能找到NuGet

Rob*_*t H 9 teamcity visual-studio nuget

我正在为.Net CI配置一个TeamCity构建服务器,我似乎无法使NuGet正常工作.

到目前为止,我已经做了以下事情:

  • 通过TeamCity管理页面启用NuGet
  • 启用NuGet构建步骤
  • 验证NuGet选项卡在构建页面上正确显示并显示正确的包

但我继续得到以下错误:

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

当我的NuGet构建步骤成功完成时,我很茫然,但我的实际解决方案构建并不是因为它没有找到NuGet

我错过了什么?

Mic*_*ckx 12

您不需要在源代码管理中的.nuget文件夹中包含nuget.exe.如果您编辑NuGet.target文件的.nuget文件夹 - 您可能在源代码管理中包含了该文件夹,那么将在第15行左右看到(所以它在我的机器上):

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

改为:

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

瞧!

迈克尔