Azure pipelines 在一个解决方案中生成两个项目,但只有一个项目进入drop文件夹

Azure pipelines 在一个解决方案中生成两个项目,但只有一个项目进入drop文件夹,azure-pipelines,Azure Pipelines,有5个项目的解决方案。其中两个需要作为单独的构件构建和发布以供部署。(1) .net framework web应用程序和(1).net framework windows服务 服务项目的存档将显示在drop文件夹中,但不会显示在web应用程序中。我搞砸了什么 我的yaml文件 # .NET Desktop # Build and run tests for .NET Desktop or Windows classic desktop solutions. # Add steps that p

有5个项目的解决方案。其中两个需要作为单独的构件构建和发布以供部署。(1) .net framework web应用程序和(1).net framework windows服务

服务项目的存档将显示在drop文件夹中,但不会显示在web应用程序中。我搞砸了什么

我的yaml文件

# .NET Desktop
# Build and run tests for .NET Desktop or Windows classic desktop solutions.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/windows/dot-net

trigger:
- master

pool:
  vmImage: 'windows-latest'

variables:
  solution: '**/*.sln'
  mySvc: '**/my.svcproj.srvc/my.svcproj.srvc.csproj'
  myWeb: '**/my.webapp.Web/my.webapp.Web.csproj'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

steps:
- task: NuGetToolInstaller@1

- task: NuGetCommand@2
  inputs:
    restoreSolution: '$(solution)'

# srvc
- task: VSBuild@1
  inputs:
    solution: '$(mySvc)'
    msbuildArgs: '/p:OutputPath="$(Build.BinariesDirectory)\$(Build.BuildId)\srvc"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

# srvc
- task: ArchiveFiles@2
  inputs:
    rootFolderOrFile: '$(Build.BinariesDirectory)\$(Build.BuildId)\srvc'
    includeRootFolder: false
    archiveType: 'zip'
    archiveFile: '$(Build.ArtifactStagingDirectory)/$(Build.BuildId)-srvc.zip'
    replaceExistingArchive: true

# web
- task: VSBuild@1
  inputs:
    solution: '$(myWeb)'
    msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation="$(build.artifactStagingDirectory)"'
    platform: '$(buildPlatform)'
    configuration: '$(buildConfiguration)'

- task: PublishBuildArtifacts@1
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: 'drop'
    publishLocation: 'Container'
[更新1]
作为测试,我完成了svc的步骤并离开了web构建。我在构建日志中得到了这个

##[警告]C:\Program Files(x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(778,5): 警告:未为项目设置OutputPath属性 “my.webapp.Web.csproj”。请检查以确保您有 为此指定了配置和平台的有效组合 项目配置=“调试”平台=“任何CPU”。你可能是 看到此消息是因为您正在尝试在没有 解决方案文件,并且已指定非默认配置或 此项目不存在的平台

相关csproj部分如下所示

  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> 

调试
任意CPU

尝试使用


建议这样做,因为PublishBuildArtifacts最终将被PublishPipelineArtifacts取代,并朝着更多管道的方向发展。这将为您发布所有内容。

我想我必须以某种方式找到我的web项目的路径。看上面的更新好的,在修复了一些东西之后,我让它工作了。路径看起来不对,但输出在那里。
  - task: PublishPipelineArtifact@1
  inputs:
    targetPath: '$(Build.ArtifactStagingDirectory)'
    artifactName: 'drop'