0

I have a solution in .Net core containing multiple projects.

  • src/Api/[ProjName].Api
  • [ProjName].FrontEnd

We are using the Azure pipelines using Azure DevOPS and we need to have a complete separate build pipelines for each of the mentioned projects. I have tried to use "Path Filters" but couldn't accomplish this. My pipeline creates a drop from the whole solution. Already reviewed this but not found the solution.

Can anyone help on this?

The Source Code Path

Azure DevOPS CI Pipeline

2 Answers 2

1

On the .Net build task, you can set the value of the field "Path to project(s)" to be the path of a specified project in the solution. The wildcard expression "**/*.csproj" will match and build all the C# projects in the solution.

enter image description here

For your case, after .Net build task, the you need to use the Copy Files task to copy the artifact files from the build output path to $(Build.ArtifactStagingDirectory).

enter image description here

Then use the **Publish Artifacts task ** to publish the artifact files from $(Build.ArtifactStagingDirectory).

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

0

we use this code to achieve that for our multi-project solution:

trigger: branches: include: - master paths: include: - src/Project1 pool: name: 'Default' vmImage: 'windows-latest' variables: buildConfiguration: 'Release' steps: - script: dotnet build src\Project1\Project1.csproj --configuration $(buildConfiguration) displayName: 'Building. Configuration: "$(buildConfiguration)"' name: 'build_solution' continueOnError: 'false' - script: dotnet test src\Project1\Project1.csproj --no-build --configuration $(buildConfiguration) displayName: 'Running tests' name: 'run_tests' continueOnError: 'false' - task: DotNetCoreCLI@2 displayName: 'Publishing' name: 'publish' continueOnError: false inputs: command: 'publish' publishWebProjects: false projects: '**/Project1.csproj' arguments: '--configuration $(BuildConfiguration) --no-build --output $(Build.ArtifactStagingDirectory)' zipAfterPublish: true - task: PublishBuildArtifacts@1 displayName: 'Publish build artifact' name: 'publish_build_artifact' continueOnError: false inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)' ArtifactName: 'Project1' publishLocation: 'Container' 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.