VS2010 - publishing a website, empty folders are ignored

In Visual Studio 2010, when publishing a website, it seems that empty folders are not published.

I am pretty sure that this behavior was introduced in vs2010. I can’t find it documented, not sure what I should call it a function or an error ... Anyway, is it possible to return to the old behavior, since I want to save the folder structure on the production server.

+4
source share
3 answers

This was reported by Microsoft with a bug report, and they said that they would not fix it. http://connect.microsoft.com/VisualStudio/feedback/details/546356/publish-deploy-does-not-deploy-empty-folders

Too bad. Because he worked in Visual Studio 2008.

Add a dummy file to the directory, such as dummy.txt, and then create the directory. Please note: there is no need to actually deploy the dummy file. It should exist only as part of the project in the build environment.

0
source

An empty folder does not have any memory value, so if you want to add a folder to a published folder, then just add any item (for example, a text file) to it and set "Copy to output directory" = Always copy or Copy, if new , this will solve your problem

-2
source

All Articles