7
votes

We are using VS2012 and have a solution with 4 website projects in it. We have added the following MSBuild arguments to our Continuous Integration msbuild arguments:

/p:DeployOnBuild=True /P:Configuration=Testing /p:DeployTarget=MsDeployPublish /p:MSDeployPublishMethod=WMSvc /p:CreatePackageOnPublish=False /p:DeployIisAppPath="{test}" /p:SkipExtraFilesOnServer=true /p:MsDeployServiceUrl={test}/MsDeploy.axd /P:AllowUntrustedCertificate=True /p:username={username}/p:password={password}

When we do a check in and the continuous integrations runs, it's publishes all 4 websites to the same directory. How do we specify which project belongs to which IIS application?

We have tried moving the settings into the csproj as suggested on How to tell TFS to deploy multiple webapps containing in one solution? After making the changes, the check in worked but it didn't publish.

1
Would it not be better to split into 4 sln one per website?James Woolfenden

1 Answers

16
votes

It's deploying to the same site because you are passing DeployIisAppPath in at the command line.

You can create a publish profile in each web application with the same name (eg. Stage.pubxml), each containing a differen DeployIisAppPath value. When you deploy, you can specify /p:PublishProfile=Stage and it will use the settings from that profile for each specific project.

If you want to specify properties like SkipExtraFilesOnServer and MsDeployServiceUrl from the command line, just remove them from your publish profiles.