0

I'm having trouble ignoring a specific project in my DevOps Pipeline. I have a WPF project in the same solution as my .Net MAUI project and I have a Pipeline for the WPF Solution that works but the .Net MAUI one fails on Nuget Restore because it's Using MAUI and a macOS-12 Image.

- task: DotNetCoreCLI@2
displayName: 'Nuget Restore'
inputs:
command: 'restore'
projects: '**/*.csproj
          !**/Portal.Desktop.csproj' # This is supposed to ignore the WPF App
feedsToUse: 'config'
nugetConfigPath: 'nuget.config'

I get a pattern matching error though so apparently that's not right

The Error

Nuget Restore

View raw log Starting: Nuget Restore

Task : .NET Core Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command Version : 2.210.0 Author : Microsoft Corporation Help : docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli

##[error]No files matched the search pattern. Finishing: Nuget Restore

3
  • Could you please share your repository structure? Commented Nov 11, 2022 at 5:47
  • Portal.Data > Portal.WPF & Portal.Data > Portal.MAUI. Basically sub project Portal.Data is just a .Net 6 Library project and feeds to both Portal.WPF and Portal.MAUI Commented Nov 11, 2022 at 17:00
  • 1
    See my answer, the issue should come from your YAML definition is incorrect. :) Commented Nov 14, 2022 at 9:10

1 Answer 1

1

I can reproduce the match error via using the below YAML:

trigger:
- none

pool:
  vmImage: 'windows-latest'

steps:
- task: DotNetCoreCLI@2
  displayName: 'Nuget Restore'
  inputs:
    command: 'restore'
    projects: '
      **/*.csproj
      !**/TestResultsTests.csproj'
    feedsToUse: 'select'
    vstsFeed: '1f64a82f-77ad-4770-a098-772faae01ed1'

enter image description here

The error disappear after change my YAML to this:

trigger:
- none

pool:
  vmImage: 'windows-latest'

steps:
- task: DotNetCoreCLI@2
  displayName: 'Nuget Restore'
  inputs:
    command: 'restore'
    projects: |                      #Here is where I change.
      **/*.csproj
      !**/TestResultsTests.csproj
    feedsToUse: 'select'
    vstsFeed: '1f64a82f-77ad-4770-a098-772faae01ed1'

enter image description here

So the issue should comes from your YAML definition.

This is my repository structure:

enter image description here

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.