简体   繁体   English

Azure DevOps Build Pipeline:“publish”命令正在执行“dotnet build”而不是“dotnet publish”

[英]Azure DevOps Build Pipeline: 'publish' command is executing 'dotnet build' instead of 'dotnet publish'

I have an azure build pipeline that I'm trying to modify to add build and publish and an azure function.我有一个 azure 构建管道,我正在尝试修改它以添加构建和发布以及一个 azure 函数。

I'm trying to run a 'publish' command using the dotnet cli, but for whatever reason, azure devops is running a 'build' command instead.我正在尝试使用 dotnet cli 运行“发布”命令,但无论出于何种原因,azure devops 正在运行“构建”命令。

My pipeline looks like this:我的管道如下所示:

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"

But when this pipeline executes, that Publish someFunction task ends up executing dotnet build instead of dotnet publish但是当这个管道执行时, Publish someFunction任务最终会执行dotnet build而不是dotnet publish

47ad-91fc-a4b1d163081b/2.175.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
2020-10-27T20:36:40.0448279Z ##[debug]/usr/bin/dotnet arg: --configuration Release -r win10-x64
2020-10-27T20:36:40.0454259Z ##[debug]exec tool: /usr/bin/dotnet
2020-10-27T20:36:40.0454556Z ##[debug]arguments:
2020-10-27T20:36:40.0454825Z ##[debug]   build
2020-10-27T20:36:40.0455170Z ##[debug]   /home/vsts/work/1/s/someFunction.csproj
2020-10-27T20:36:40.0456258Z ##[debug]   -dl:CentralLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.175.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.175.0/dotnet-build-helpers/Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"
2020-10-27T20:36:40.0457276Z ##[debug]   --configuration
2020-10-27T20:36:40.0457663Z ##[debug]   Release
2020-10-27T20:36:40.0463060Z ##[debug]   -r
2020-10-27T20:36:40.0463499Z ##[debug]   win10-x64
2020-10-27T20:36:40.0465119Z [command]/usr/bin/dotnet build /home/vsts/work/1/s/someFunction.csproj -dl:CentralLogger,"/home/vsts/work/_tasks/DotNetCoreCLI_5541a522-603c-47ad-91fc-a4b1d163081b/2.175.0/dotnet-build-helpers

Anyone have any ideas why this might be happening?任何人都知道为什么会发生这种情况? There are no errors being displayed, it just isn't executing the right command...没有显示错误,只是没有执行正确的命令...

Your error is commands: "publish" .您的错误是commands: "publish" It should be command , not commands .它应该是command ,而不是commands

Because you have not included a command value, it uses the default value of Build.因为您没有包含command值,所以它使用 Build 的默认值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 dotnet publish 调用对 Azure devops 的意外调用 - dotnet publish invokes unexpected call to Azure devops 我可以使用 dotnet publish 命令来构建 .NET Framework 应用程序吗? - Can I use dotnet publish command to build .NET Framework applications? 我可以在 Azure DevOps 中使用 dotnet publish 命令发布 .net 框架 4.7.1 解决方案吗 - Can I publish .net framework 4.7.1 solution with dotnet publish command in Azure DevOps 通过 build.cake 而不是 Azure Devops 发布构建工件 - Publish build artifact through build.cake instead of Azure Devops docker build 期间 dotnet 发布失败 - dotnet publish fails during docker build do.net build 和 do.net publish 命令有什么区别? - What is the difference between dotnet build and dotnet publish commands? 在 Azure Devops Pipeline 中使用 MSBuild 构建和发布 MVC4 应用程序 - Build and Publish MVC4 application using MSBuild in Azure Devops Pipeline 在asp.net核心中的post build事件中运行dotnet发布 - running dotnet publish in post build event in asp.net core “dotnet publish”命令行会跳过部署到Azure Functions - The 'dotnet publish' command line skips deployment to Azure Functions dotnet 发布命令的 azure-pipelines.yml 中的转义空格 - Escape spaces in azure-pipelines.yml for the dotnet publish command
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM