【发布时间】:2022-01-15 01:03:21
【问题描述】:
我有一个 dotnet 解决方案,其中包含测试和库项目 + 一个 Azure Functions 项目。
我已将所有 nuget 包更新为最新版本,并将 Azure Functions 项目设置为
<TargetFramework>net6.0</TargetFramework>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
在 VS2022 中,现在一切正常,所有测试都通过了。
但是,当我的 Azure DevOps 构建管道运行其 nuget restore 任务时,我收到很多关于与 net60 不兼容的各种包的错误,例如:
Package Serilog.Extensions.Hosting 4.1.2 is not compatible with net60 (.NETFramework,Version=v6.0).
构建管道的恢复任务的yaml是:
- task: NuGetCommand@2
displayName: Restore
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'select'
构建管道设置为运行:
jobs:
job: Build
displayName: Build
pool:
vmImage: 'windows-latest'
谁能解释为什么该解决方案可以在我的笔记本电脑上恢复和构建正常但在管道中失败?
【问题讨论】:
标签: .net azure-devops msbuild nuget