Artifact packaging ignoring empty folders

Steven's Avatar


26 Oct, 2017 01:12 PM

Hey guys,
I'm creating an artifact after doing a dotnet publish, but it doesn't include what is on disk.
It's missing a folder that is created, but empty.
Is there some kind of "optimisation" that does not include empty folders in an artifact?
If that is the case, is there a switch to override this behaviour?


  1. Support Staff 1 Posted by Ilya Finkelshte... on 26 Oct, 2017 06:39 PM

    Ilya Finkelshteyn's Avatar

    Hi Steven,

    This is default zip behavior, we did not introduce this intentionally. Anyway you can zip your folder manually with special 7z switches and then package your own .zip file as an artifact. This YAML worked for me:

    - mkdir contains-empty-folders\folder1
    - mkdir contains-empty-folders\folder2
    - cmd: 7z a -r -tzip contains-empty-folders
    - path:
  2. 2 Posted by Steven on 27 Oct, 2017 08:11 AM

    Steven's Avatar

    Thank you for the response Ilya.
    I wasn't sure, hence the question.
    I've been using 7zip on my desktop/laptop for a few years and had not noticed this, hence the confusion.
    I will use the cmd to create the zip.

  3. 3 Posted by Steven on 30 Oct, 2017 12:57 PM

    Steven's Avatar

    Hi Ilya, that did not work for me unfortunately... Any ideas?

  4. 4 Posted by Steven on 30 Oct, 2017 01:44 PM

    Steven's Avatar

    I managed to figure it out:

    I needed to add * to the path for the 7zip command

  5. Support Staff 5 Posted by Ilya Finkelshte... on 30 Oct, 2017 05:34 PM

    Ilya Finkelshteyn's Avatar

    Thank you for update. However I am a little bit surprised that you were needed to update path. AppVeyor build worker images have path set to 7z (not 7zip) command by default. I would recommend to ensure that you do not have commands which overwrite path variable (instead of updating it).

  6. 6 Posted by Steven on 31 Oct, 2017 08:37 AM

    Steven's Avatar

    Hi Ilya, I meant the path to the folder to zip up,
    i.e. in the case of your example it would look like this:

    7z a -r -tzip contains-empty-folders\*

  7. Support Staff 7 Posted by Ilya Finkelshte... on 31 Oct, 2017 08:25 PM

    Ilya Finkelshteyn's Avatar

    I see, thanks for clarification.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac