\"Publish\"." />
开发者

Visual Studio creates (empty) folder in /bin for build action "Content" while publishing

开发者 https://www.devze.com 2022-12-30 09:37 出处:网络
I have a Web Application Project in Visual Studio 2005 that I publish using \"Project\" -> \"Publish\".

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号