如何使用MSBuild脚本自动化特定发布配置文件的Web部署? [英] How to automate Web Deploy of a specific Publish Profile with an MSBuild script?
问题描述
我有一个Visual Studio 2012解决方案,其中包含三个Web项目.他们每个人都有一个Web部署发布配置文件,该配置文件在特定目录中创建一个程序包.该解决方案本身也具有特殊的部署配置.
I have a Visual Studio 2012 solution, which contains three web projects. Each of them has a web deploy publish profile, which creates a package in a specific directory. The solution itself also has a special Deployment configuration.
使用msbuild,在部署"配置中构建解决方案很容易,但是如何使用msbuild构建脚本/任务(而不是调用命令行),使用特定的配置文件发布3个Web项目. ?
Using msbuild, building the solution in a Deployment configuration is easy, but how can I publish the 3 web projects using a specific profile using an msbuild build script/task (rather than invoking command lines)?
推荐答案
我认为您可以尝试以下操作:
I think you can try the following:
msbuild.exe MyProject.csproj /p:DeployOnBuild=true;PublishProfile=MyProfile
正如Steve所指出的那样,
Sayed Ibrahim Hashimi的这篇帖子似乎可以解决您从msbuild发布的详细要求.
as pointed by Steve, this post by Sayed Ibrahim Hashimi seems to address your requirement publish from an msbuild in detail.
这篇关于如何使用MSBuild脚本自动化特定发布配置文件的Web部署?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!