[英]The NuGet Installer task used in TFS 2017 build definition fails to clear the global-packages folder with an error
We have a build definition in place created in TFS 2017, which builds a .net solution that has dependency on some of our NuGet packages, during compilation the solution restores the NuGet package from packages (global-packages) folder present at this path %userprofile%\\.nuget\\packages
instead of downloading latest one from our internal feed. 我们在TFS 2017中创建了一个构建定义,该构建定义构建了一个依赖于我们某些NuGet软件包的.net解决方案,在编译过程中,该解决方案从该路径%userprofile%\\.nuget\\packages
处的package(global-packages)文件夹中还原了NuGet软件包%userprofile%\\.nuget\\packages
而不是从内部供稿中下载最新的%userprofile%\\.nuget\\packages
。
I saw a command at this page to avoid using the global-packages folder, but when I added the nuget locals global-packages -clear
argument in NuGet installer task, which is used to restore the nuget packages, the task failed with the below error saying unknown option -Clear
. 我在此页面上看到了一个避免使用global-packages文件夹的命令,但是当我在用于还原nuget软件包的NuGet安装程序任务中添加nuget locals global-packages -clear
参数时,该任务失败并出现以下错误说unknown option -Clear
。
The NuGet Version I am using is 3.5.0 in the task. 我正在使用的NuGet版本在任务中为3.5.0。
2019-09-05T09:27:18.8819742Z ##[section]Starting: NuGet restore $(build.sourcesdirectory)/IntelliSuiteService.sln
2019-09-05T09:27:18.8819742Z ==============================================================================
2019-09-05T09:27:18.8819742Z Task : NuGet Installer
2019-09-05T09:27:18.8819742Z Description : Installs or restores missing NuGet packages
2019-09-05T09:27:18.8819742Z Version : 0.2.31
2019-09-05T09:27:18.8819742Z Author : Microsoft Corporation
2019-09-05T09:27:18.8819742Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613747)
2019-09-05T09:27:18.8819742Z ==============================================================================
2019-09-05T09:27:19.4601187Z [command]C:\Windows\system32\chcp.com 65001
2019-09-05T09:27:19.4757465Z Active code page: 65001
2019-09-05T09:27:19.5069958Z Detected NuGet version 3.5.0.1938 / 3.5.0
2019-09-05T09:27:19.5226206Z SYSTEMVSSCONNECTION exists true
2019-09-05T09:27:19.5226206Z [command]F:\Builds\NextGen_Gated\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe restore -NonInteractive F:\Builds\NextGen_Gated\2\s\SuiteService.sln -NoCache nuget locals global-packages -Clear
2019-09-05T09:27:20.1007732Z Unknown option: '-Clear'
2019-09-05T09:27:20.1163983Z ##[error]Error: F:\Builds\NextGen_Gated\_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.31\node_modules\nuget-task-common\NuGet\3.5.0\NuGet.exe failed with return code: 1
2019-09-05T09:27:20.1163983Z ##[error]Packages failed to install
2019-09-05T09:27:20.1320334Z ##[section]Finishing: NuGet restore $(build.sourcesdirectory)/SuiteService.sln
You should run the command separately from the nuget restore
command. 您应该与nuget restore
命令分开运行该命令。
You can can log in to the agent machine and run it from the command line, or in the build add a command line or batch task that run the command. 您可以登录到代理计算机并从命令行运行它,或者在构建中添加运行该命令的命令行或批处理任务。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.