##[error]Project file(s) matching the specified pattern were not found

Posting just in case this helps anyone in the future

I had my vmImage set as ubuntu with the following set:

projects: '**\*.csproj'

The backslash was throwing things off, I had to switch to the following:

projects: '**/*.csproj'

I copied from a guide that was assuming Windows. Subtle enough, it took me a while to notice


You need to define in the build task which .csproj files you want to build.

In your case, the definition is in a variable $(Parameters.projects).

- task: DotNetCoreCLI@2
  displayName: Build
  inputs:
    projects: '$(Parameters.projects)'

    arguments: '--configuration $(BuildConfiguration)'

You can replace this variable in your .csproj (e.g. **/*.csproj for all .csproj files in all subfolders):

- task: DotNetCoreCLI@2
  displayName: Build
  inputs:
    projects: '**/*.csproj'

    arguments: '--configuration $(BuildConfiguration)'

Or go to the variables tab and add the Parameters.projects variable:

enter image description here

Tags:

Azure Devops