Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to tell MSBuild to publish many web projects into one directory?

Tags:

msbuild-4.0

I am running Automatic Builds with TFS 2010. In a solution I have more than one web applications which are all located under the same root directory - e.g.:

RootDir ->

   WebApplicationProject1.csproj
   WebApplicationProject2.csproj
   ...

When I run automated build, I set the following arguments for MSBuild:

/p:DeployOnBuild=true;DeployTarget=PipelinePreDeployCopyAllFilesToOneFolder;_PackageTempDir="\computer\Builds\Published" /p:SkipExtraFilesOnServer=true

However MSBuild does not preserve existing content in this folder and with each project the content in this folder is being deleted. The last project to be built is the winner.

Can I make MSBuild not to delete the content in this folder and only replace existing files?

Thanks for any information on this matter.

like image 903
Ivan Zlatanov Avatar asked Dec 22 '10 11:12

Ivan Zlatanov


People also ask

How do I publish an entire solution in Visual Studio?

To publish your app from Visual Studio, do the following: Change the solution configuration from Debug to Release on the toolbar to build a Release (rather than a Debug) version of your app. Right-click on the project (not the solution) in Solution Explorer and select Publish. In the Publish tab, select Publish.


1 Answers

You do not have to create multiple build configurations. Simply define a solution that contains both projects, create a build definition for this solution and add a AfterDropBuild target that copies everything form the PublishedWebservices output subfolders to a common folder.

like image 157
eFloh Avatar answered Oct 18 '22 10:10

eFloh