Azure YAML 构建;在解决方案中仅构建单个项目?

dic*_*... 7 yaml azure azure-devops

我有多个项目 - 它们是逻辑应用程序 - 在一个解决方案下

ProjectA
projectB
...
projectF
Run Code Online (Sandbox Code Playgroud)

我使用VS 构建任务创建了一个 YAML 构建任务,但是我只想构建一个特定的项目,并为每个项目(逻辑应用)创建单独的 YAML。使用solution:参数我只能定位 .sln 文件,该文件在该解决方案下构建每个项目(逻辑应用程序).​​..

是否可以针对单个项目?

Vit*_*Liu 6

我们可以通过任务Visual Studio Build构建单个项目。如果要构建单个项目,请使用该solution: {.csproj file path}参数并输入 .csproj 文件,它将仅针对一个项目。

另外,请检查.csproj文件并确保项目之间没有依赖关系。

样本

steps:
- task: VSBuild@1
  displayName: 'Build .csproj file'
  inputs:
    solution: {.csproj file path}
    vsVersion: 16.0
    platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
Run Code Online (Sandbox Code Playgroud)