以下是为我的开发环境生成的发布配置文件:
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>\\dev\webroot</publishUrl>
<DeleteExistingFiles>False</DeleteExistingFiles>
</PropertyGroup>
</Project>
我想我想做的事情非常简单,我只是想在我想要发布相同项目的地方添加一个额外的发布网址。不幸的是,我还没有找到任何关于如何以简单的方式做到这一点的信息。所有这些都表明我需要实现一些复杂的 msdeploy 解决方案或简单地回退到脚本(即 ps/batch + robocopy/xcopy),这是不可取的。
我想人们可以简单地做这样的事情:
<publishUrl>\\dev\webroot;\\dev2\webroot2</publishUrl>
or
<itemGroup>
<publishUrl>\\dev\webroot;</publishUrl>
<publishUrl>\\dev2\webroot;</publishUrl>
</itemGroup>
主要问题是:如何扩展我的发布配置文件以通过 FTP 或文件系统部署到多个位置?
如果是 RTFM 回复,请参阅我可以阅读的地方。
UPDATE如果可以使用 FTP 进行多次部署,我也会对这样的解决方案感兴趣。
我不确定 VS 中的发布选项是考虑到这一点而开发的。我唯一建议的是,当您的项目部署到第一个目的地时,您可以使用像 robocopy 这样的工具将所有内容复制到新文件夹,它使用起来非常简单,这是一个示例命令行使用:
robocopy <SRCFOLDER> <TGTFOLDER> /E /XO /XF *.config
rem /E : Copy Subfolders, including Empty Subfolders.
rem /XO : eXclude Older - if destination file exists and
is the same date or newer than the source - don't overwrite it.
rem /XF *.config : excludes all .config files from copy operation
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)