访问 Azure Pipelines 中私有 Nuget 服务器中托管的 Nuget 包

问题描述

我们有几个 nuget 包推送到私有 nuget 包,尝试设置 Azure Pipelines,但是在构建过程中显示错误 NU1101:运行步骤“nuget store”时无法找到包

注意在本地 Visual Studio 中,当我们在 VPN 中时可以访问它

解决方法

如果您使用的是私有 nuget 服务器。您需要在可以访问私有 nuget 服务器的本地计算机上 create self-hosted agent。并选择您的 private agent pool 以在自托管代理上运行您的 Azure 管道。

因为您的私有 nuget 服务器对云托管代理不可用。如果您在云托管代理上运行管道,管道中的 nuget 还原步骤将无法找到您的包。

如果您在代理后面工作。请查看以下文档以配置自托管代理的代理设置。

Run a self-hosted agent behind a web proxy