[英]Azure DevOps pipeline fails at Restore - Test project is not compatible with netcoreapp2.2 Project supports: netcoreapp3.0
[英]NuGet Restore task fails (not compatible with netcoreapp2.2), but it works in Visual Studio
我正在嘗試在 Azure 管道中構建一個存儲庫。 它在 Visual Studio 中構建正常,但是當使用 Azure 管道(在構建機器上運行代理)時,它失敗並出現以下錯誤:
The nuget command failed with exit code(1) and error
Project MyProject is not compatible with netcoreapp2.2 (.NETCoreApp,Version=v2.2).
Project MyProject supports: netstandard2.0 (.NETStandard,Version=v2.0)
我怎樣才能解決這個問題?
這是 yaml 構建腳本:
pool:
name: MyBuildServer
demands:
- msbuild
- visualstudio
steps:
- task: NuGetCommand@2
displayName: 'NuGet restore'
- task: VSBuild@1
displayName: 'Build solution **\*.sln'
- task: VSTest@2
displayName: 'Run tests'
inputs:
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\*test*.dll
!**\*TestAdapter.dll
!**\obj\**
searchFolder: '$(System.DefaultWorkingDirectory)'
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.