【问题标题】:Is it possible to access private nuget server from Azure DevOps?是否可以从 Azure DevOps 访问私有 nuget 服务器?
【发布时间】:2020-03-13 23:12:30
【问题描述】:

我想设置一个管道,但在 NuGet 还原时它失败了

Errors in packages.config projects

    Unable to find version '1.0.0.5' of package 'mypackage'.

      https://api.nuget.org/v3/index.json: Package 'mypackage.1.0.0.5' is not found on source 'https://api.nuget.org/v3/index.json'.

##[error]The nuget command failed with exit code(1) and error(Errors in packages.config projects

此包实际上存储在我公司的本地 NuGet 服务器(内部网络)上,无法从 Internet 获取。

Azure DevOps 是否可以访问这些包?

【问题讨论】:

    标签: azure-devops


    【解决方案1】:

    是的,有可能。

    1. 您需要有一个自托管代理 ==> 例如视窗。 https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops
    2. 将 nuget 存储在本地 Nuget 存储库中是有意义的
    3. 设置 Nuget.config 以将其指向您的存储库。 4、在NuGet Restore任务中一定要选择Feeds to use --> 'Feeds in my NuGet.config'

    ==> Private-Repo 示例:https://medium.com/@churi.vibhav/creating-and-using-a-local-nuget-package-repository-9f19475d6af8

    【讨论】:

    • 从 devops 中的工件中,我为 nuget.exe 创建了一个新的提要,并按照说明创建了一个 nuget.config 并将其放置在解决方案目录中,但在最后一步我要指定什么作为 nuget.exe push -Source "tempnuget" -ApiKey az <packagePath> 我尝试将路径放入本地提要(作为 url),但说该文件不存在
    • => azuredevopslabs.com/labs/azuredevops/packagemanagement ===> 第 16 步 ==> API 密钥 = 任何字符串。
    • 我得到了它的工作,感谢您将我指向自托管代理。
    • 非常好 :) 你能把我的答案标记为答案吗?谢谢 :)
    猜你喜欢
    • 1970-01-01
    • 2021-06-21
    • 2016-08-10
    • 1970-01-01
    • 2022-07-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-07-04
    相关资源
    最近更新 更多