0

我有一个多项目解决方案(具有多个 Web 项目、天蓝色功能项目等)。我希望能够单独构建每个项目,并将其部署到单独的应用程序服务。我读了这个问题:Azure DevOps: 1 Solution Multiple Projects CI/CD,它要求使用路径过滤器,但它没有具体说明如何 - 有多个地方/方法可以做到这一点,我不确定哪个是正确的.

我试过这个:

variables:
  solution: '**/MyProject1.csproj'
  buildPlatform: 'Any CPU'
  buildConfiguration: 'Release'

构建工作,但在这publish artifact一步它告诉我:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(776,5): Warning : The OutputPath property is not set for project 'MyProject1.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Release'  Platform='Any CPU'.  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.
Project "D:\a\1\s\MyProject1\MyProject1.csproj" on node 1 (default targets).

它说该项目不存在configurationand ,但它确实存在。release

我也试过:

trigger:
  branches:
    include:
    - master    
  paths:
    include:
    - MyProject1/*

构建也有效,没有警告,但是,构建工件发布复制了整个解决方案。所以 - 我不认为它实际上只建立了一个项目。

任何需要做什么的细节表示赞赏。

4

1 回答 1

0

因此 - 如果您的项目是在较旧版本的 Visual Studio(2015 或更早版本)中创建的,则平台值设置为AnyCPU(即使下拉菜单显示Any CPU)- 在较新版本中,它设置为Any CPU. 打开您的 .csproj 文件,然后检查其中的内容。

于 2020-03-08T04:32:40.953 回答