Visual Studio 2015 为路径添加 ACL 时发布速度极慢
Visual Studio 2015 extremely slow Publish while adding ACL's for path
我在 Web 项目的根文件夹中有一个文件夹,可以在生产 Web 服务器上填充重要的用户特定 files/folders,这些在项目中不可用。 (例如 /Content/docs)
这个文件夹可以增长到几千个 files/folders,因此当我将新版本发布到网络服务器时,可能需要几分钟才能将 ACL 添加到该特定路径。
根据这个 Microsoft Document 我可以排除一个文件夹不被发布,但是如果我想偶尔 add/publish 个文件到这个文件夹怎么办?
我应该如何配置 wpp.targets XML 来实现这个配置?
(p.s。我正在使用 VisualStudio 的 Web 部署 UI。)
如果你想偶尔add/publish文件到这个文件夹wpp.targets XML,stuartd的建议应该是一个可行的方法。有一种更简单的方法可以满足您的要求。当您想要 add/publish 个文件到此文件夹时,您可以在发布前删除 wpp.targets 个文件。
注意:删除前注意备份wpp.targets文件。
一种方法是创建两个发布配置文件,一个包含文件,一个不包含文件。
根据 this page,排除文件意味着将“要部署的项目”下拉列表设置为“只有 运行 此应用程序需要的文件”:
来自页面:
- Only files needed to run this application
This will include only the files required to run the application. Specifically, files to be included will be those found in the bin folder and those files whose Build Action property = Content (such as .aspx, .ascx, and .master).
对于其他选项:
All files in this project: This will include all files within the project file.
All files in this project folder: This will include all files in the source project folder, including those not listed in the project file and those marked as 'exclude'.
该页面还展示了如何使用项目文件中的 ExcludeFilesFromDeployment
和/或 ExcludeFoldersFromDeployment
元素在粒度级别上执行此操作。
我在 Web 项目的根文件夹中有一个文件夹,可以在生产 Web 服务器上填充重要的用户特定 files/folders,这些在项目中不可用。 (例如 /Content/docs)
这个文件夹可以增长到几千个 files/folders,因此当我将新版本发布到网络服务器时,可能需要几分钟才能将 ACL 添加到该特定路径。
根据这个 Microsoft Document 我可以排除一个文件夹不被发布,但是如果我想偶尔 add/publish 个文件到这个文件夹怎么办?
我应该如何配置 wpp.targets XML 来实现这个配置?
(p.s。我正在使用 VisualStudio 的 Web 部署 UI。)
如果你想偶尔add/publish文件到这个文件夹wpp.targets XML,stuartd的建议应该是一个可行的方法。有一种更简单的方法可以满足您的要求。当您想要 add/publish 个文件到此文件夹时,您可以在发布前删除 wpp.targets 个文件。
注意:删除前注意备份wpp.targets文件。
一种方法是创建两个发布配置文件,一个包含文件,一个不包含文件。
根据 this page,排除文件意味着将“要部署的项目”下拉列表设置为“只有 运行 此应用程序需要的文件”:
来自页面:
- Only files needed to run this application This will include only the files required to run the application. Specifically, files to be included will be those found in the bin folder and those files whose Build Action property = Content (such as .aspx, .ascx, and .master).
对于其他选项:
All files in this project: This will include all files within the project file.
All files in this project folder: This will include all files in the source project folder, including those not listed in the project file and those marked as 'exclude'.
该页面还展示了如何使用项目文件中的 ExcludeFilesFromDeployment
和/或 ExcludeFoldersFromDeployment
元素在粒度级别上执行此操作。