Building .Net 1.1 Code In Team Foundation Server 2008

written by Rob Aquila on Monday, August 25 2008

The current company I am working for is in the process of refreshing their development environment from Visual Studio 2003 and Source Safe to Visual Studio 2008 and TFS 2008.  During this process one of the major hurdles I had to cross was to implement an automated build that could then be used as part of our new continuous integration process.  Since we were moving towards Team Foundation Server 2008 we wanted to figure out how we could leverage this instead of using something else like Cruise Control .Net to build our code.  TFS 2008 provides the framework to automate the build process during check in, but since we are building 1.1 code we had to figure out the best way to implement this. 

One option was to use MSBee.  This would require us to convert all our 2003 projects to 2005 projects.  One issue we saw with that was developers would then have to locally do the same and this would cause developers to lose features found in the IDE, like the ability to compile code through the UI interface. 

In the end we decided to do what was least intrusive to the developer.  This meant keeping the project files 2003 and using the MSBuild exec command to build those solutions.

 

Once you have a build configured in TFS, the modifications to the build project file are as follows: 

  • First, remove the SolutionToBuild section since we are not going to use this to build our solutions.  
  • Next, create a target section with the name AfterCompile.  Inside this section is where you are going to use the exec command to load up devenv.com to build the solutions.
  • Finally, I added some Property Group parameters to point to the location of devenv.com.

 

Here is the MSBuild code:

<PropertyGroup>
    <VS2003_Devenv>$(ProgramFiles)\Microsoft Visual Studio .NET 2003\Common7\IDE\devenv.com</VS2003_Devenv>
    <VS2003_Configuration>Debug</VS2003_Configuration>
</PropertyGroup> 

<Target Name="AfterCompile"> 
     <Exec Command="&quot;$(VS2003_Devenv)&quot; &quot;$(SolutionRoot)\ObjectSolutions\solution1.sln&quot; /build $(VS2003_Configuration)" /> 
     <Exec Command="&quot;$(VS2003_Devenv)&quot; &quot;$(SolutionRoot)\ObjectSolutions\solution2.sln&quot; /build $(VS2003_Configuration)" /> 
     <Exec Command="&quot;$(VS2003_Devenv)&quot; &quot;$(SolutionRoot)\ObjectSolutions\solution3.sln&quot; /build $(VS2003_Configuration)" /> 
     <Exec Command="&quot;$(VS2003_Devenv)&quot; &quot;$(SolutionRoot)\ObjectSolutions\solution4.sln&quot; /build $(VS2003_Configuration)" /> 
</Target>

 

You will need to install the same tools that are found on the developer's workstations, on the build server.  Visual Studio 2003, Team Foundation Server MSSCCI Provider, and Team Explorer 2008.  This will also work in a 2005 environment setup if you have yet to upgrade to 2008. 

In my next post I will talk about how to build ASP.net 1.1 code using MSBuild.

Similar Posts

  1. Using VSDBCMD and MSBUILD to Build and Deploy DBPro Projects
  2. Team Foundation Server Build Notification Screen
  3. Configure App.config Application Settings During MSI Install

Comments are closed

Options:

Size

Colors