I have a Web Application Project in Visual Studio 2005 that I publish using "Project" -> "Publish".
The App uses some (text) files that live in a top-level folder; let us call it textfiles
for example.
What I would like to achieve is that Visual Studio creates a top-level folder called textfiles
on the target when publishing. The folder should contain the text files it contains on my local machine when publishing.
I got pretty close by setting the "Build Action" to "Content" and the "Copy to Output Directory" to "Do not copy" in the settings of the text files. This makes VS开发者_运维问答 create a top-level folder called textfiles
that contains the files I want. But it also creates an empty textfiles
-folder in /bin, which I do not want/need.
Is there a way to have VS ditch the empty folder? Preferably without a post build event (is that how you call those?). I felt like "Do not copy" should do the trick...
By the way the other settings I use for publishing are "Delete all existing files" and "Only files needed"; Include App_Code is deactivated.
Open your proj file in notepad and search for "Copy to Output Directory" node.Delete it and try.
精彩评论