如何将我的发布配置文件扩展到部署到多个位置? [英] How can I extend my publish profile to deploy to multiple locations?
问题描述
以下是我的开发环境生成的发布配置文件:
The following is the generated publish profile for my dev environment:
<?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),这是不希望的。
What I want to do I would imagine is very easy, I simply want to add an additional publish url where I want to publish the same project. Unfortunately I haven´t been able to find anything on how to do this in a straightforward manner. All suggests that I need to implement some complex msdeploy solution or simply fallback to scripting (i.e. ps/batch + robocopy/xcopy) which is undesirable.
我想象一个可以简单请执行以下操作:
I imagined one could simply do something like:
<publishUrl>\\dev\webroot;\\dev2\webroot2</publishUrl>
或
<itemGroup>
<publishUrl>\\dev\webroot;</publishUrl>
<publishUrl>\\dev2\webroot;</publishUrl>
</itemGroup>
主要问题是:
如何通过FTP或文件系统将发布配置文件扩展到多个位置?
如果是RTFM响应,请参考我可以阅读的地方。
In case of RTFM responses - please refer to somewhere I can read up on this.
更新
如果可以使用FTP进行多次部署,我会对这种解决方案感兴趣。
UPDATE If it is possible to do multiple deploy with FTP I would be interested in such a solution as well.
推荐答案
我使用的是VS 2012;不知道你正在使用什么版本的VS,但是您正在使用下面的发布配置文件。
I'm using VS 2012; not sure what version of VS you are using - but you are using publish profiles so below should work.
我认为您只需要创建一个新的发布配置文件即可然后将配置为使用您的其他发布URL。似乎很简单,所以我希望我没有错过你的问题。
I think that you simply need to create a new publish profile that you will then configure to use your additional publish URL. Seems simple so I hope I'm not missing something in your question.
这篇关于如何将我的发布配置文件扩展到部署到多个位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!