One of the FAQs in Team Foundation forums have been on “how to build .NET 1.1 application using Team Build”. My colleague Nagaraju put up this blog to give out detailed steps for this. Apart from this, there were various other solutions on how to build .NET 1.1 using MSBuild (and hence in turn by Team Build) from different folks like one by Jomo.
All this solutions were essentially a hack… they mostly worked but lacked elegance. The developers wanted better solution. Considering the increasing demand for better support for building .NET 1.1 using MSBuild, the MSBuild team came up with project called MSBee or MSBuild Everett (code name for VS 2003) Environment. The Beta 2 of MSBee is available here.
The MSBee could be used with Team Build also. To do so, you need to do the following –
- Install MSBee and other required components on the Build Machine. (Refer MSBee ReadMe)
- Upgrade the solutions that you want to build to Visual Studio 2005 format using the wizard or the /upgrade command line switch. (If you want to still use VS 2003, you can backup the solutions and upgrade.)
- Modify the TFSBuild.proj file as mentioned below.
The modification required in TFSBuild.proj are –
a) Download and checkin the attached BuildingFx11inTB.targets alongside TFSBuild.proj. (I am trying attachment to a blog for the first time… hopefully it will work!)
b) Add an import statement to TFSBuild.proj file after import of Microsoft.TeamFoundation.Build.targets file. The import statement would look like –
<Import Project=“$(MSBuildProjectDirectory)\BuildingFx11inTB.targets“ />
c) Add following property to point to the 1.1 targets file –
<PropertyGroup> <AdditionalPropertiesForBuildTarget>CustomAfterMicrosoftCommonTargets=$(ProgramFiles)\MSBuild\MSBee\MSBuildExtras.Fx1_1.CSharp.targets</AdditionalPropertiesForBuildTarget> </PropertyGroup>
And thats all. The steps a) and b) are required because the current version of the targets file did not provide easy way to pass additional properties while compiling individual project files. We are considering fixing this for next release to simplify this.
Note that the above solutions assume that all your projects are in C#. Instead, if all the projects are in VB, change the MSBuildExtras.Fx1_1.CSharp.targets in the property defination above to MSBuildExtras.Fx1_1.VisualBasic.targets. In case you have mix of C# and VB, use the workaround suggested in section 4.2.2 of “MSBee ReadMe.doc”