【发布时间】:2021-11-20 22:58:00
【问题描述】:
我已将我的网站更新为 .net 6。它也可以在本地运行。但是,我在 Azure DevOps 中的 yaml 管道不再运行。像这样的解决方案中所有 .csproj 文件的发布步骤都存在错误。我不知道,如何配置它应该使用 .net 6。
C:\Program Files\dotnet\sdk\5.0.403\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(141,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 6.0. Either target .NET 5.0 or lower, or use a version of the .NET SDK that supports .NET 6.0. [D:\a\1\s\04_Contracts\Contracts\Contracts.csproj]
##[error]Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1
这是发布的管道步骤。
- task: DotNetCoreCLI@2
displayName: 'dotnet publish'
inputs:
command: publish
publishWebProjects: false
projects: '**/*.csproj'
arguments: '-r linux-x64 --output $(build.artifactstagingdirectory)'
【问题讨论】:
标签: azure-devops azure-pipelines pipeline azure-pipelines-yaml