Azure DevOps构建管道:“发布”命令正在执行“ dotnet构建”,而不是“ dotnet发布”

时间:2020-10-27 21:22:23

标签: c# .net azure .net-core azure-devops

我有一个天蓝色的构建管道,我正在尝试修改该管道以添加构建和发布以及一个天蓝色的函数。

我正在尝试使用dotnet cli运行“发布”命令,但是出于某种原因,azure devops却在运行“ build”命令。

我的管道如下所示:

C++

但是当执行此管道时,该trigger: - master variables: solution: "**/*.sln" jobs: - job: backend_build - task: DotNetCoreCLI@2 inputs: commands: "publish" publishWebProjects: false projects: "someFunction.csproj" arguments: "--configuration Release -r win10-x64" displayName: "Publish someFunction" - task: PublishPipelineArtifact@1 inputs: path: "$(System.DefaultWorkingDirectory)/someFunction/bin/Release/netcoreapp3.1/win10-x64/publish.zip" artifact: "ApplyMigrations" displayName: "Publish someFunction Function" 任务最终执行了Publish someFunction而不是dotnet build

dotnet publish

任何人都知道为什么会发生这种情况吗?没有显示任何错误,只是没有执行正确的命令...

1 个答案:

答案 0 :(得分:0)

您的错误是commands: "publish"。应该是command,而不是commands

因为您没有包括command值,所以它使用Build的默认值。

相关问题