Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild: adding/copying empty folders via Zip/Copy task

I'm trying to create copy/zip a pre-compiled site which is contains empty folders(after pre-compilation). Looks like empty folders is not included to the list of items after CreateItem task. How I can care of empty folders?

thanks

like image 920
Sergey Avatar asked Jun 24 '09 15:06

Sergey


1 Answers

I don't feel that this is the most elegant solution, but what we have done before is, creating a folder in the solution, and a text file called placeholder.txt or something similar, and the setting the properties of the text file to be included in the build. The result is a folder where you want it containing a file that you don't want. We then delete the placeholder.txt file before we zip it up, all within the build script.

Not elegant but it does the job for our scenario.

like image 182
Rihan Meij Avatar answered Oct 11 '22 04:10

Rihan Meij