How do you make it so that, when publishing a web project in VS2010, it also publishes an empty folder ?
Doing some research, I saw that it could be done by including any file in this folder, giving properties and selecting it as "content", in this way it includes the folder (and the file as well).
Isn't there a cleaner way, so to speak, to publish the project with just the empty folder I need?
The cleanest procedure is to modify the "post build event" and add the command to create the folder there. You do this from the project properties:
With this, every time the project builds, the folder will be created, and this includes the build that goes into the webdeploy.
" post-build event " is available if your web application should be built as a Web Project not a Web Site . Look at the following screenshots.
In VS 2010 you can also use " post-build event "
How to: Specify Build Events (C#)
Another option is to create the folder in the VS project and place any file there, for example dummy.txt, and mark the properties of this file like this:
And one more option , you can always encapsulate the use of that folder in your source code, and ask that if the folder doesn't exist then create it.