Azure-devops-docs: Question about multiple projects

Created on 11 Oct 2018  Â·  7Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

The code example is for building all projects is like:

- task: DotNetCoreCLI@2
  inputs:
    command: 'build'
    projects: '**/*.csproj'

But how to build multiple projects defined by csproj filenames?
Like building ./src/ClassLibrary1/ClassLibrary1.csproj and ./src/ClassLibrary2/ClassLibrary2.csproj.

This command fails:

- task: DotNetCoreCLI@2
  inputs:
    command: 'build'
    projects: './src/ClassLibrary1/ClassLibrary1.csproj;./src/ClassLibrary2/ClassLibrary2.csproj'

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

devopprod doc-bug

Most helpful comment

@zuckerthoben This does work perfectly.

Can you also add this to the Microsoft documentation ?

All 7 comments

@azooinmyluggage for dotnet core tasks

Use the following syntax (use pipes):

task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
command: build
projects: |
*/proj1.csproj
*
/proj2.csproj

@zuckerthoben This does work perfectly.

Can you also add this to the Microsoft documentation ?

Sure I could, but I am unsure where to exactly put this.

I updated the doc and raised a PR: https://github.com/MicrosoftDocs/vsts-docs/pull/4528

This looks to have been resolved and will be closing this issue.
@GiriB we are closing this page as it is covered in DotNetCoreCLI Task documentation. Is it ok if I copy your code from your PR to that page?

@chasewilson Please go ahead :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

atrauzzi picture atrauzzi  Â·  3Comments

robinmanuelthiel picture robinmanuelthiel  Â·  3Comments

dtamai picture dtamai  Â·  3Comments

o-o00o-o picture o-o00o-o  Â·  3Comments

cijujoseph picture cijujoseph  Â·  3Comments