1

I have a .artifactignore at the root of my repository that looks like:

**/*
!**/bin/**/*
!**/obj/**/*

I can observe the .artifactignore being evaluated in the logs such as this:

Uploading pipeline artifact from d:\a\1\s for build #10471
Information, ApplicationInsightsTelemetrySender will correlate events with X-TFS-Session GUID
Information, DedupManifestArtifactClient will correlate http requests with X-TFS-Session GUID
Information, Using .artifactignore file located at: d:\a\1\s\.artifactignore for globbing
Information, Processing .artifactignore file surfaced 20721 files. Total files under source directory: 21471

This correctly excludes everything but bin and obj directories. I would like to extend this .artifactignore such that it has the additional behavior:

  • Ignores all pdb files regardless of their location

I have tried several variations:

**/*
!**/bin/**/*
!**/obj/**/*
*.pdb
**/*
!**/bin/**/*
!**/obj/**/*
.pdb
**/*
!**/bin/**/*
!**/obj/**/*
**/*.pdb
**/*
!**/bin/**/*
!**/obj/**/*
!!*.pdb
**/*
!**/bin/**/*
!**/obj/**/*
!!**/*.pdb
**/*
!**/bin/
!**/obj/
!!**/*.pdb

With several other variations I'm sure. All of these contain all of the .pdb files that are present in the bin folders.

How do I publish all the bin and obj folders without bringing along the .pdb files?

Erick
  • 732
  • 2
  • 8
  • 18

1 Answers1

2

How do I publish all the bin and obj folders without bringing along the .pdb files?

I am afraid there is no such out of box syntax you could re-include a file if a parent directory of that file is excluded.

That means, you use the syntax !**/bin/**/* to exclude the parent folder bin from the .artifactignore file, you could not re-use the syntax *.pdb or any other to re-include the file .pdb.

As the document state:

Refer to the Git guidance on the .gitignore syntax, the syntax for .artifactignore is the same.

To check the details info, you could refer this thread about .gitignore syntax.

As workaround for this issue, we could use following syntax to including all the file types except the .pdb file:

**/*

!**/bin/**/*.dll
!**/bin/**/*.xml
!**/bin/**/*.config

!**/obj/**/*.dll
!**/obj/**/*.xml
!**/obj/**/*.config

Hope this helps.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135