1

I'm using TFS2013 to build and publish a single Web project to a local folder on the build machine. As specified here I just add the parameters below as msbuild parameters and it works, including the Web.config transforms.

/p:DeployOnBuild=true;DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder;PackageTempRootDir="\\sharedfolder";AutoParameterizationWebConfigConnectionStrings=false

Now I'm dealing with a solution containing multiple Web projects. I'd like to end up with multiple local folders, one per Web project. The solution above doesn't seem to work (only generates one of the projects). I also checked the _PublishedWebsites in the drop folder but those files don't have the transforms applied.

Is there a way to do this?

Community
  • 1
  • 1
oscarmorasu
  • 901
  • 3
  • 11
  • 28

1 Answers1

2

you can achieve this by setting up publish profile for each project. Add publish profile for each Project with same name. you can use File system Publish Method to Publish the output to different directories for each project.

Just call the Publish profile in the Ms-build Argument.

/p:DeployOnBuild=true;PublishProfile=yourProfileName

Follow this link for more details http://msdn.microsoft.com/en-us/library/dd465337(v=vs.110).aspx use File System instead of Web Deploy.

suresh2
  • 1,129
  • 2
  • 15
  • 25
  • This is the recommended approach – Sayed Ibrahim Hashimi Apr 01 '14 at 09:33
  • Thanks for the reply, it helps a lot. Now, in TFS I have multiple builds for different environments (DEV, QA, PROD). It's a lot of ground work adding three different .pubxml to each project. I'm considering adding only one "publish.pubxml" to each project that will work as a placeholder. Then add some custom logic in the build template to actually edit the raw xml on every build in order to: Change the build configuration (to match DEV,QA or PROD properly) and the output folder, nested somewhere in the dropfolder. Is this too crazy or there's a better way to do this? – oscarmorasu Apr 01 '14 at 18:31
  • You need to add .pubxml file only to your Web Project and not to all other type Projects. if you have many Web projects to deploy and if you don't want to add additional .pubxml for each environment, then custom build template is the only option. The advantage of separate pubxml for each environment is, you can also deploy the code from visual studio and it is easy to change the folder location. – suresh2 Apr 08 '14 at 17:07