使用TFS的托管生成服务器上的nuget软件包文件夹在哪里? [英] Where is the nuget packages folder located on a hosted build server using TFS?

查看:112
本文介绍了使用TFS的托管生成服务器上的nuget软件包文件夹在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要从一个软件包执行命令行实用程序,该软件包是在TFS构建过程中作为nuget软件包还原的一部分下载的.

I need to execute a command line utility from a package that is downloaded as part of nuget package restore in the TFS build process.

在我的本地计算机上,该计算机存储在c:\ users \ me.nuget *

On my local computer that is stored in c:\users\me.nuget*

我尝试了在TFS上进行的所有排列,但均未成功.我也尝试过\ mydir \ packages也没有成功.

I've tried every permutation of that on TFS without success. I've also tried \mydir\packages with no success as well.

最大的问题是,我必须先运行软件包还原步骤,然后才能查看日志中的任何反馈.那是一些缓慢的调试.

The biggest problem is that I have to run the package restore step before being able to see any sort of feedback from the log. That's some slow debugging.

有什么想法吗?谢谢你.

Any ideas? Thanks ahead.

推荐答案

Nuget程序包缓存文件夹位于C:\ Users \ buildguest.nuget \ packages中,但如果使用托管生成服务器,则在生成后将对其进行清理. 验证的简单方法:

The Nuget package cache folder is in C:\Users\buildguest.nuget\packages, but it will be cleaned after build if you are using Hosted build server. The simple way to verify:

  1. 添加NuGet还原或.Net Core Restore构建步骤以还原软件包
  2. 添加PowerShell构建步骤以列出C:\ Users \ buildguest.nuget \ packages中的文件

代码:

Get-ChildItem -Path C:\Users\buildguest\.nuget\packages

  1. 排队构建并检查PowerShell步骤日志(软件包将在日志中列出)
  2. 删除/禁用NuGet还原或.Net Core Restore构建步骤>保存构建定义
  3. 队列建立
  4. 由于路径不存在,构建将失败.

因此,如果不存在,则需要在构建解决方案/项目之前还原软件包.您可以将软件包添加到源代码管理中,并映射到构建代理以处理恢复软件包所需的时间过长的问题.

So, the packages need to be restored before build solution/project if aren’t existing. You can add packages to source control and map to build agent to deal with the issue of too long time takes to restore packages.

这篇关于使用TFS的托管生成服务器上的nuget软件包文件夹在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆