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'
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@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 :)
Most helpful comment
@zuckerthoben This does work perfectly.
Can you also add this to the Microsoft documentation ?