【问题标题】:Include nuget prerelease in nuget restore in azure buid pipeline在 azure buid 管道中的 nuget restore 中包含 nuget prerelease
【发布时间】: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


【解决方案1】:

还原仅适用于 nuget 5.x。要在恢复数据之前安装 nuget 5.x,, 将此行添加到您的 azure-pipelines.yml

- task: NuGetToolInstaller@1
  displayName: 'Install nuget 5.x'
  inputs:
    versionSpec: '5.x'

【讨论】:

  • 感谢您在这里分享您的解决方案,您可以接受它作为答案。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-01-09
  • 1970-01-01
  • 2020-01-19
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多