gpt4 book ai didi

azure-devops - YAML Nuget还原

转载 作者:行者123 更新时间:2023-12-04 05:11:51 25 4
gpt4 key购买 nike

尝试使用新的YAML生成功能在Azure DevOps中创建生成配置,但是,当引用NuGet.config文件(放在我的项目文件夹的根目录中)时,我似乎无法使Nuget还原正常工作

在我的YAML构建文件中,我有:

- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'

feedsToUse: config

nugetConfigPath: 'NuGet.config'

在我的日志中,得到以下信息:
2018-09-25T17:25:07.4624712Z ##[section]Starting: NuGet restore
2018-09-25T17:25:07.4631787Z ==============================================================================
2018-09-25T17:25:07.4631904Z Task : NuGet
2018-09-25T17:25:07.4632707Z Description : Restore, pack, or push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Package Management and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task.
2018-09-25T17:25:07.4632875Z Version : 2.0.41
2018-09-25T17:25:07.4632964Z Author : Microsoft Corporation
2018-09-25T17:25:07.4633086Z Help : [More Information] (https://go.microsoft.com/fwlink/?LinkID=613747)
2018-09-25T17:25:07.4633196Z ==============================================================================
2018-09-25T17:25:08.2066658Z SYSTEMVSSCONNECTION exists true
2018-09-25T17:25:08.2581545Z SYSTEMVSSCONNECTION exists true
2018-09-25T17:25:08.3645811Z [command]C:\Windows\system32\chcp.com 65001
2018-09-25T17:25:08.3743733Z Active code page: 65001
2018-09-25T17:25:08.4044581Z Detected NuGet version 4.7.0.5148 / 4.7.0+9245481f357ae542f92e6bc5e504fc898cfe5fc0
2018-09-25T17:25:08.4061452Z SYSTEMVSSCONNECTION exists true
2018-09-25T17:25:08.4082708Z Saving NuGet.config to a temporary config file.
2018-09-25T17:25:08.4321725Z ##[section]Finishing: NuGet restore

我试过使用
    nugetConfigPath: '$(Build.SourcesDirectory)\\NuGet.config'

相反,结果相同

关于如何使NuGet恢复以与NuGet.config文件一起使用的任何想法?

最佳答案

我已经弄清楚了,NuGet任务需要更改为:

- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '**\*.sln'

feedsToUse: config

nugetConfigPath: 'NuGet.config'

(唯一需要更改的是 restoreSolution。)

关于azure-devops - YAML Nuget还原,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52503984/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com