Azure Pipelines: "No packages matched the search pattern."
Asked Answered
C

7

8

I am writing a YAML pipeline that should publish a NuGet package.

When coming to the deployment job I get a warning: "No packages matched the search pattern." The package is there and it is confirmed by the log

Downloaded drop/PackageName.1.0.0.nupkg to d:\a\1\drop\PackageName.1.0.0.nupkg

and the variable packagesToPush is set to **/*.nupkg;!**/*.symbols.nupkg.

What am I missing here?

I also tried with different folders like $(Build.ArtifactgDirectory)/**/*.nupkg;!$(Build.ArtifactDirectory)/**/*.symbols.nupkg

Costume answered 13/3, 2020 at 23:22 Comment(0)
C
1

After multiple attempts, this works:

'$(Pipeline.Workspace)/**/drop/*.nupkg'
Costume answered 14/3, 2020 at 14:25 Comment(2)
Great! Thanks for sharing your solution here, you could Accept it as an Answer , so it could help other community members who get the same issues and we could archive this thread, thanks!Leningrad
this was working all the time. suddenly stopped working for me also. did Microsoft change something?Francesfrancesca
D
12

You should use $(System.DefaultWorkingDirectory) instead of $(Build.ArtifactgDirectory).

$(System.DefaultWorkingDirectory)/**/*.nupkg;!$(System.DefaultWorkingDirectory)/**/*.symbols.nupkg
Doorframe answered 14/10, 2020 at 8:43 Comment(0)
I
2

you have a typo in ArtifactgDirectory.

Injured answered 28/1, 2022 at 17:45 Comment(2)
This answer isn't helpful because it doesn't point out the typo. Also, this question already has a satisfactory answer, so we should leave it alone unless there is something new to add (e.g. based on a new technology that changes the solution).Whodunit
He does. Well spotted :)Edette
C
1

After multiple attempts, this works:

'$(Pipeline.Workspace)/**/drop/*.nupkg'
Costume answered 14/3, 2020 at 14:25 Comment(2)
Great! Thanks for sharing your solution here, you could Accept it as an Answer , so it could help other community members who get the same issues and we could archive this thread, thanks!Leningrad
this was working all the time. suddenly stopped working for me also. did Microsoft change something?Francesfrancesca
C
1

We are running on Windows agents and had to use backward slashes:

$(System.DefaultWorkingDirectory)\**\*.nupkg
Candler answered 22/1, 2021 at 9:9 Comment(0)
M
0

Today I checked and this is the only one that worked for me:

$(System.DefaultWorkingDirectory)/_ArtifactSourceAlias/drop/*.nupkg

Change _ArtifactSourceAlias with your project name.

Or see the below image to see where to find it. Source Alias Textbox enter image description here

happy testing!!!

Mahatma answered 15/1, 2022 at 5:16 Comment(0)
M
0

Pay attention to you back or forward slashes if you work with a linux vmImage

For me the problem was back slashes (Wrong path: '<path>\<project name>.csproj' for ubuntu-latest)

...
      vmImage: ubuntu-latest #Part of the problem

  - task: DotNetCoreCLI@2
      inputs:
        command: 'restore'
        projects: '<path>/<project name>.csproj' #Correct! path for ubuntu-latest
...
Mortgagor answered 19/8, 2022 at 0:9 Comment(0)
S
0

I had this issue, but none of the above suggestions fixed it. In the end, my Copy Files step had Clean Target Folder = true.

Setting to False fixed it

Semiskilled answered 21/6 at 11:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.