【发布时间】:2020-05-07 15:10:51
【问题描述】:
我有一个包含多个项目的解决方案。
DSS.DMN.Client 项目依赖于其他项目(有参考)
这就是我的 yaml 文件的样子
- task: MSBuild@1
displayName: 'Build solution Client'
inputs:
platform: anyCPU
maximumCpuCount: true
configuration: 'Integration'
solution: DSS.DMN.Client
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '**\bin\**'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
问题是客户端的配置为 INT,但其他两个依赖项目的配置为调试。
现在当我运行构建时出现错误:
##[error]C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(777,5): Error : The OutputPath property is not set for project 'DSS.DMN.AVModule.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='INT' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.
问题是 build 正在尝试为 DSS.DMN.AVModule.csproj 的项目查找 INT 配置,尽管它只有调试配置。
问题:如何在我的构建管道上为单个构建中的不同项目提供不同的配置?
【问题讨论】:
-
您是否尝试过在管道中使用 msbuild 任务构建每个项目,然后将 dll 文件复制到引用项目中?
-
@LeoLiu-MSFT:我将 MsBuild 转换为 vsbuild@1 并且成功了。
-
很高兴您解决了您的问题。既然你已经解决了,请将你的评论转换为答案吗?这可能有利于其他社区成员阅读答案,避免在已经有答案的帖子上花费大量时间。谢谢。
标签: azure-devops azure-pipelines devops azure-pipelines-build-task