VS2010 - 发布网站,空文件夹被忽略
在 Visual Studio 2010 中,发布网站时,似乎没有发布空文件夹。
我非常确定这种行为是在 vs2010 中引入的。我在任何地方都找不到它的记录,不确定我是否应该将其称为功能或错误...无论如何,是否可以恢复到旧的行为,因为我希望将文件夹结构保留在生产服务器上。
In visual studio 2010, when publishing a website, it seems that empty folders are not being published.
I am quite sure that this behavior were introduced in vs2010. I cant find it documented anywhere, not sure if I should call it a feature or a bug... Anyway, is it possible to revert to the old behavior as I wish to keep my folder structure on the production server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这实际上是 Microsoft connect 站点上报告的 vs2010 的限制
http://vishaljoshi.blogspot.com/2007/11/wdp-does-not-publish-empty-folders.html
http://connect.microsoft.com /VisualStudio/feedback/details/546356/publish-deploy-does-not-deploy-empty-folders
This is actually a limitation of vs2010 as reported on the Microsoft connect site
http://vishaljoshi.blogspot.com/2007/11/wdp-does-not-publish-empty-folders.html
http://connect.microsoft.com/VisualStudio/feedback/details/546356/publish-deploy-does-not-deploy-empty-folders
微软向微软提交了一份关于此问题的错误报告,他们表示不会修复它。
http://connect.microsoft .com/VisualStudio/feedback/details/546356/publish-deploy-does-not-deploy-empty-folders
太糟糕了。因为它以前在 Visual Studio 2008 中工作。
将一个虚拟文件(如 dummy.txt)添加到目录中,然后将创建该目录。
请注意,无需实际部署虚拟文件。它只需要作为构建环境中项目的一部分存在。
There was a bug report to Microsoft about this 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 it used to work in Visual Studio 2008.
Add a dummy file like dummy.txt to the directory and then the directory will be created.
Note that it is not necessary to actually deploy the dummy file. It only needs to exist as part of the project in the build environment.
空文件夹没有任何内存值,因此如果您想将文件夹添加到已发布的文件夹中,只需向其中添加任何项目(例如文本文件)并设置“复制到输出目录” = 始终复制或如果较新则复制这将解决您的问题
The Empty folder doesn't have any memory value so if you want to add your folder's into your published folder then simply add any item(e.g. text File) into it and set the "Copy to output directory" = Copy always or Copy if Newer this will resolve you problem