Msbuild 在解决方案中连续部署多个网站项目

Msbuild 在解决方案中连续部署多个网站项目,msbuild,visual-studio-2012,continuous-integration,msdeploy,continuous-deployment,Msbuild,Visual Studio 2012,Continuous Integration,Msdeploy,Continuous Deployment,我们正在使用VS2012,有一个包含4个网站项目的解决方案。我们已将以下MSBuild参数添加到连续集成MSBuild参数中: /p:DeployOnBuild=True/p:Configuration=Testing/p:DeployTarget=MsDeployPublish/p:MSDeployPublishMethod=WMSvc/p:createpackageopublish=False/p:deployiisappath=“{test}”/p:SkipExtraFilesOnServ

我们正在使用VS2012,有一个包含4个网站项目的解决方案。我们已将以下MSBuild参数添加到连续集成MSBuild参数中:

/p:DeployOnBuild=True/p:Configuration=Testing/p:DeployTarget=MsDeployPublish/p:MSDeployPublishMethod=WMSvc/p:createpackageopublish=False/p:deployiisappath=“{test}”/p:SkipExtraFilesOnServer=True/p:MsDeployServiceUrl={test}/MsDeploy.axd/p:AllowUntrustedCertificate=True/p:username={username}/p:password={密码}

当我们签入并运行连续集成时,它会将所有4个网站发布到同一目录。如何指定哪个项目属于哪个IIS应用程序


我们已尝试按照上的建议将设置移动到csproj中。在进行更改后,签入工作正常,但未发布。

它正在部署到同一站点,因为您正在命令行中传入
DeployiisAppath

您可以在每个web应用程序中创建具有相同名称的发布配置文件(例如,
Stage.pubxml
),每个文件都包含不同的
DeployIisAppPath
值。部署时,可以指定
/p:PublishProfile=Stage
,它将为每个特定项目使用该概要文件中的设置


如果要从命令行中指定属性,如
SkipExtraFilesOnServer
MsDeployServiceUrl
,只需从发布配置文件中删除它们。

将每个网站拆分为4个sln不是更好吗?谢谢,这对我帮助很大。@Michael@Richard Szalay是否存在只有第一个编译的项目才使用发布配置文件的情况?