簡體   English   中英

構建 azure Pipeline 中一些庫的“nuget restore”問題

[英]Problem with "nuget restore" with some lib's in build azure Pipeline

我正在使用 netcoreapp3.1 並且一切都適用於命令 dotnet restore 和 dotnet build,但是在構建管道中,使用的命令是 nuget restore,這會導致以下錯誤:

 Package Microsoft.AspNetCore.JsonPatch 3.1.1 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.AspNetCore.JsonPatch 3.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.Extensions.Logging.Abstractions 3.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.Logging.Abstractions 3.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    Package Microsoft.Extensions.DependencyInjection.Abstractions 3.0.0 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1). Package Microsoft.Extensions.DependencyInjection.Abstractions 3.0.0 supports: netstandard2.0 (.NETStandard,Version=v2.0)
    One or more packages are incompatible with .NETCoreApp,Version=v3.1.

在我的場景中,我必須安裝 NuGet 5.4.0(與 .NET Core 3.1 一起發布)來解決這個問題

如果在 Azure DevOps 中使用 YAML 模板,您可以添加此任務:

- task: NuGetToolInstaller@1
  inputs:
    versionSpec: '5.4.0'

我使用了錯誤的代理規范,正確的是 windows-2019 我使用的是 windows-2017

這解決了

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM