$(Agent.ToolsDirectory) TFS 代理位置? “.NET Core Installer Tool”步骤缓存问题

$(Agent.ToolsDirectory) TFS agent location? Issues with '.NET Core Installer Tool' step caching

我们有一位开发人员遇到了与下面链接的问题类似的问题:

Build/Publish .NET Core 3.x application with TFS 2018 Update 3.2

我们在构建服务器上安装了 .NET core 3.1.101,但是当 运行 使用 .NET Core Installer Tool 步骤构建时,它没有选择缓存版本。它一直尝试从 Internet 安装,这是不允许的。

有人知道 Windows 上 TFS 构建代理的 $(Agent.ToolsDirectory) 位置吗? (我们在 TFS 2018)

注意:我们已将 3.1.101 文件夹放在几个位置以进行测试。例如,我们将它放在 "E:\agent\buildAgentName_work_tool\dotnet" 位置。 *我们创建了 dotnet 文件夹名称。

有什么想法吗?

编辑:更多日志信息...

Tool to install: .NET Core sdk version 3.1.1.
Checking if a cached copy exists for this version...
Cache does not contains this particular .NET Core. Will be downloaded and installed.
...
[error]Failed to download .NET Core package. Please ensure that .NET Core sdk of version 3.1.1 exists. Check out: https://github.com/dotnet/core/blob/master/release-notes/releases.csv

AND 在 TFS 中使用的步骤屏幕:

TFS 2018 NET Core Installer Tool

Agent.ToolsDirectory

The directory used by tasks such as Node Tool Installer and Use Python Version to switch between multiple versions of a tool. These tasks will add tools from this directory to PATH so that subsequent build steps can use them.

您可以在这里参考我们的官方文档:Use predefined variables-- Agent variables

由于您使用的是自己的代理,敬请learn about managing this directory on a self-hosted agent


更新

然后指向代理,打开 capabilities 选项卡并单击 Add capability

在左边空白处输入Agent.ToolsDirectory,添加你的xxx安装的文件路径。比如我安装在我代理的文件_work_tool

更多细节请看这个问题的答案:How to configure different versions of Ruby / any other software in self hosted agent?