【发布时间】:2019-12-09 21:59:01
【问题描述】:
如何在使用 azure 构建管道时恢复 nuget 包,包括预发布版本?
- task: NuGetCommand@2
displayName: Restore
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'select'
vstsFeed: '<guid>'
错误
Package Swashbuckle.AspNetCore 5.0.0-rc2 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0). Package Swashbuckle.AspNetCore 5.0.0-rc2 supports: netstandard2.0 (.NETStandard,Version=v2.0)
已解决
我必须先安装 nuget 5.x!
解决方案
在恢复任何包之前,我已将以下 nuget 安装添加到我的构建管道中:
- task: NuGetToolInstaller@1
displayName: 'Install nuget 5.x'
inputs:
versionSpec: '5.x'
【问题讨论】:
-
您在恢复预发布包时遇到特定问题吗?
-
@DanielMann 我已附上错误消息
-
@BendEg,看来你已经用 nuget 5.x 解决了这个问题,你介意分享你的解决方案作为答案吗?所以它可以帮助其他遇到相同问题并更容易找到答案的社区成员,谢谢。
-
@LeoLiu-MSFT 完成,解决方案非常简单
-
@BendEg,谢谢,最好将您的答案与问题分开,例如this thread。
标签: azure-devops nuget azure-pipelines nuget-package-restore