用本地副本替换匹配文件 VS2015 发布

Replace matching files with local copies VS2015 publish

我记得在 Visual Studio 2010 年有 "Replace matching files with local copies" 复选框

这个 checkbox/radiobutton 在 Visual Studio 2015 年在哪里?

在 VS2015 中,无法在发布中设置此选项 Window。

但我们可以换一种方式。右键单击项目->属性->Package/Publish Web->要部署的项目

根据 MSDN,我们有这些 options

Only files needed to run this application. This is the default value. Visual Studio tries to determine which files are required for the application to run successfully. For example, this includes assemblies in the bin folder, files generated during the build, and files marked as Content. To see if a file is marked as Content, select the file in Solution Explorer, and check the file's Build Action property in the Properties window. You can change the Build Action value to Content to cause the file to be deployed, or change it to something else, such as None, to prevent the file from being deployed. Some file types that are automatically set to Content include .master, .svc, .ashx, .asax, .skin, .browser, .config, .and sitemap. A file must be included in the project in order to have a Build Action property.

All files in this project. Visual Studio deploys all files that are included in the project, regardless of their Build Action property values.

All files in the project folder. Visual Studio deploys all files that are in the project folder and subfolders, regardless of whether they are included in the project or their Build Action property values.

更新

我想出了另一种方法来在发布期间更新所有文件。当我的一些文件没有正确更新(配置、ascx 等)时,我遇到了问题,在我的 inetpub 文件夹中我有旧版本的文件。所以首先我在另一个新文件夹中发布网站,然后用新文件夹中的文件替换 inetpub 文件夹中的文件。