在 VS 2010 中发布时摆脱 Thumbs.db

Get rid of Thumbs.db when publish in VS 2010

我将发布设置、要部署的项目更改为 "All files in this project"。由于在发布前将 Thumbs.db 复制到临时路径时出错,发布未成功。

Error 49 Copying file help\GenderType_help\images\Thumbs.db to obj\Debug\Package\PackageTmp\help\GenderType_help\images\Thumbs.db failed. Could not find file 'help\GenderType_help\images\Thumbs.db'.

如何删除这些不需要的 Thumbs.db 待发布文件。

您可以让 Windows 停止创建它们,这里有两个指南;

https://www.sitepoint.com/switch-off-thumbs-db-in-windows/

http://www.howtogeek.com/210764/fix-file-in-use-deletion-errors-on-network-drives-by-disabling-windows-thumbnail-generation/

在我找不到确切答案之后,这就是我将所有文件包含在复制项目中的方法。

  1. 已将要部署的项目更改为 Only files needed to run this application
  2. 将所有文件的生成操作 属性 更改为 Content

然后复制项目中的所有项目文件,而没有项目部署到 "All files in this project"。

在您的项目解决方案资源管理器中找到文件 thumbs.db - 可能需要打开显示所有文件设置。从解决方案中删除文件 Thumbs.db。然后发布