简体   繁体   English

TFS 2017构建定义中使用的NuGet安装程序任务无法清除全局包文件夹并显示错误

[英]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.

相关问题 Nufs安装程序任务在tfs 2017版本中失败 - Nuget Installer task fails in tfs 2017 builds 如何在TFS 2017构建定义上创建一个包含任务的文件夹? - How to simply create a folder with a task on TFS 2017 build definition? TFS 2017-构建期间的NuGet Publisher步骤因401未经授权而失败 - TFS 2017 - NuGet Publisher step during a build fails with 401 Unauthorized 将 git 与 TFS 一起使用时如何包含 NuGet 包“build”文件夹 - How to include NuGet packages "build" folder when using git with TFS 在Visual Studio Build步骤中使用NuGet Installer任务和“Restore Nuget Packages”有什么区别? - What's the difference using NuGet Installer task and “Restore Nuget Packages” in Visual Studio Build step? TFS 2013构建定义使访问.nuget出错(类型UnauthorizedAccessException) - TFS 2013 Build definition giving error to access .nuget (type UnauthorizedAccessException) 在NuGet恢复时TFS构建失败 - TFS Build fails at NuGet restore TFS NuGet安装程序构建步骤不起作用 - TFS NuGet Installer build step not working TFS中NuGet软件包文件夹的正确tfignore是什么? - What is the proper tfignore for NuGet packages folder in TFS? tfs构建定义没有drop文件夹 - tfs build definition with no drop folder
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM