smo*_*sen 10 azure-devops azure-pipelines-build-task
尝试使用新的 YAML 构建功能在 Azure DevOps 中创建构建配置,但是在引用 NuGet.config 文件(位于我的项目文件夹的根目录中)时,我似乎无法使 Nuget 恢复工作
在我的 YAML 构建文件中,我有:
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '$(Parameters.solution)'
feedsToUse: config
nugetConfigPath: 'NuGet.config'
Run Code Online (Sandbox Code Playgroud)
在我的日志中,我得到以下信息:
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
Run Code Online (Sandbox Code Playgroud)
我试过使用
nugetConfigPath: '$(Build.SourcesDirectory)\\NuGet.config'
Run Code Online (Sandbox Code Playgroud)
相反,结果相同
关于如何让 NuGet 还原与 NuGet.config 文件一起工作的任何想法?
我想通了,NuGet 任务需要更改为:
- task: NuGetCommand@2
displayName: 'NuGet restore'
inputs:
restoreSolution: '**\*.sln'
feedsToUse: config
nugetConfigPath: 'NuGet.config'
Run Code Online (Sandbox Code Playgroud)
(唯一需要改变的是restoreSolution。)
| 归档时间: |
|
| 查看次数: |
5069 次 |
| 最近记录: |