blog community
Web Deployment projects in a Team Build.

Recently one of our customers decided to incorporate Team System into there development process. They wanted to migrate al there existing sources from there source repository system to Team Foundation Version Control.

The sources mainly exist of ‘old’ asp code and some vb 6.0 code. There is some .NET 1.1 code as well but it will be migrated to .NET 2.0.

I have been asked to help implement a Team Foundation Build to compile the .NET code and deploy the deliverables as well as the asp files.

 

As described in this post, Team Build calls various targets. Some of those targets are already implemented by Microsoft. One of the default implemented targets is the CoreDropBuild target. This target is responsible for copying the output files to a deployment directory.

The files being copied are the assemblies that are created in the build, the program database files and files that are marked in the projects as files to be copied to the output directory (property: Copy To Output Directory is set to true.)

Al these files, for all the solutions in the build, are copied to a single directory. Unfortunately, this results in some unwanted behavior. Because all the files are copied to a single directory, files with the same filename are overwritten and only one copy of a file with a specific filename is available in this directory.

Furthermore, because all the files are dropped into a single directory, directory structures needed for the application (especially websites) are no longer available.

Fortunately Microsoft recently released a new project type, the Web Deployment project type that helped us a lot.

This project is linked to a Web site project or a Web application project and ensures that the websites are correctly deployed using MsBuild.

 

A small problem occurs however when those web deployment projects are used in a Team Build environment. Because the default Team Build implementation builds the output of all the projects in a build to a single build directory, the bin directory for each project is empty. The Web Deployment project however expects that the binaries for the web site/application projects are located in those bin directories.

As the Visual Studio 2005 project files are actually MsBuild files, this problem is easily fixed. Just add some custom MsBuild code to the web site/application project files to copy the output files back.

 

Here is an example of the MsBuild code I used, to copy the binaries back to the project bin folder.

 

<Target Name="AfterBuild">

<CreateItem Include="$(OutDir)\$(AssemblyName).*">

       <Output ItemName="FilesToCopy" TaskParameter="Include" />

CreateItem>

 

<Copy SourceFiles="@(FilesToCopy)"

      DestinationFiles="@(FilesToCopy –> '$(MSBuildProjectDirectory)\Bin\%(Filename)%(Extension)')"

      ContinueOnError="true"

/>

 

<ResolveAssemblyReference

      Assemblies="$(AssemblyName)"            

      SearchPaths="$(OutDir);{TargetFrameworkDirectory};{GAC}"

      TargetFrameworkDirectories="$(TargetFrameworkDirectory)"

      FindDependencies="true"

      FindSatellites="true"

      FindSerializationAssemblies="true"

      FindRelatedFiles="true">

    <Output TaskParameter="CopyLocalFiles" ItemName="RefToCopy" />

ResolveAssemblyReference>

 

<Copy SourceFiles="@(RefToCopy)"

             DestinationFiles="@(RefToCopy -> '$(MSBuildProjectDirectory)\Bin\%(Filename)%(Extension)')"

             ContinueOnError="true"

/>

Target>

 

The AfterBuild target is used to copy the project output (binaries) and the appropriate referenced assemblies back to the bin folder. This target is one of the targets that are provided by Microsoft to add customizations.

 

Hopes this helps, 


Posted 27-06-2006 10:28 by martijnb
Filed under:

Comments

Jedi Meditations wrote Team Foundation Build and Web Deployment Projects
on 08-11-2006 1:34

Last week I decided it was time to start generating regular builds of the web application my team is...

Aaron Hallberg wrote Team Build and Web Deployment Projects
on 09-07-2007 15:19

Various issues arise when trying to use Team Build with Web Deployment Projects (which are a Visual Studio

nfpdwbqooys wrote re: Web Deployment projects in a Team Build.
on 15-10-2009 6:43

n87EU4  <a href="ahlzwadpvbph.com/.../a>, [url=http://mhqubakwcuxu.com/]mhqubakwcuxu[/url], [link=http://agudwrgdosbw.com/]agudwrgdosbw[/link], http://hqdhqtvwdvao.com/

Buhric wrote re: Web Deployment projects in a Team Build.
on 28-10-2009 10:06

<a href="www.cpmythbusters.net/online-slots.php"">www.cpmythbusters.net/online-slots.php">video">www.cpmythbusters.net/online-slots.php">video slots</a> [url="www.cpmythbusters.net/online-slots.php"">www.cpmythbusters.net/online-slots.php"]video slots[/url] www.cpmythbusters.net/online-slots.php  282026

Chandru wrote re: Web Deployment projects in a Team Build.
on 28-10-2009 10:34

<a href="www.endstoploss.com/online-casino.aspx"">www.endstoploss.com/online-casino.aspx">casino">www.endstoploss.com/online-casino.aspx">casino bonus</a> [url="www.endstoploss.com/online-casino.aspx"">www.endstoploss.com/online-casino.aspx"]casino bonus[/url] www.endstoploss.com/online-casino.aspx  8-[[

internelink wrote re: Web Deployment projects in a Team Build.
on 27-12-2009 21:18

<a href="www.phentermine-tablets.com"">www.phentermine-tablets.com/">phentermine</a>">www.phentermine-tablets.com/.../a> [url="www.phentermine-tablets.com"">www.phentermine-tablets.com/"]phentermine[/url] www.phentermine-tablets.com  27740

James wrote re: Web Deployment projects in a Team Build.
on 29-12-2009 13:26

Good Post... The web development projects will help to team build..They need mutually helping for development for Site.

newklear wrote re: Web Deployment projects in a Team Build.
on 29-12-2009 18:52

<a href="www.levitraguidance.com"">www.levitraguidance.com/">levitra</a>">www.levitraguidance.com/.../a> [url="www.levitraguidance.com"">www.levitraguidance.com/"]levitra[/url] www.levitraguidance.com  128567

kuftasn wrote re: Web Deployment projects in a Team Build.
on 17-01-2010 6:41

XFIsay  <a href="tgtmitwjlwac.com/.../a>, [url=http://zdmeqlmgctwe.com/]zdmeqlmgctwe[/url], [link=http://qumovjvzxwip.com/]qumovjvzxwip[/link], http://bdrtgfqjumsw.com/

kuftasn wrote re: Web Deployment projects in a Team Build.
on 17-01-2010 6:41

XFIsay  <a href="tgtmitwjlwac.com/.../a>, [url=http://zdmeqlmgctwe.com/]zdmeqlmgctwe[/url], [link=http://qumovjvzxwip.com/]qumovjvzxwip[/link], http://bdrtgfqjumsw.com/

Pharmk764 wrote re: Web Deployment projects in a Team Build.
on 20-01-2010 7:00

Very nice site! <a href="apxyieo.com/.../1.html">cheap viagra</a>

Pharma375 wrote re: Web Deployment projects in a Team Build.
on 20-01-2010 7:01

Very nice site!  [url=apxyieo.com/.../2.html]cheap cialis[/url]

Pharmk916 wrote re: Web Deployment projects in a Team Build.
on 20-01-2010 7:01

Very nice site! cheap cialis apxyieo.com/.../4.html

Pharme362 wrote re: Web Deployment projects in a Team Build.
on 20-01-2010 7:01

Very nice site!

debt cures wrote re: Web Deployment projects in a Team Build.
on 03-03-2010 12:24

So where it to find, <a href= wss-id.org/.../watchmywife.aspx >All about watch my wife</a> [url=wss-id.org/.../watchmywife.aspx]All about watch my wife[/url],  8))), <a href= wss-id.org/.../debtsettlement.aspx >debt settlement</a> [url=wss-id.org/.../debtsettlement.aspx]debt settlement[/url],  993, <a href= wss-id.org/.../onlinegamblingdebts.aspx >Cheap online gambling debts</a> [url=wss-id.org/.../onlinegamblingdebts.aspx]Cheap online gambling debts[/url],  :), <a href= wss-id.org/.../unsecureddebtconsolidationloans.aspx >unsecured debt consolidation loans free</a> [url=wss-id.org/.../unsecureddebtconsolidationloans.aspx]unsecured debt consolidation loans free[/url],  79544, <a href= wss-id.org/.../debtcures.aspx >debt cures free</a> [url=wss-id.org/.../debtcures.aspx]debt cures free[/url],  =-DDD,

snipe point little cayman wrote re: Web Deployment projects in a Team Build.
on 04-03-2010 21:58

very stupid

silktime.net/.../snipe-point-little-cayman.html you can snipe point little cayman

Add a Comment

(required)  
(optional)
(required)  
Remember Me?
Enter code (required)
Powered by Community Server (Commercial Edition), by Telligent Systems