Go to content Go to navigation Go to search

Brokenwire.NET::Programming

Building .NET 1.1 projects with Team Foundation Server
· 2009-11-30 10:14 by Thijs Kroesbergen for Brokenwire.NET

Recently Olav Kwakman and I collaborated for the challenge to build .NET 1.1 code with a TFS 2008 build environment.

After configuring the build server we asked Captain Google what to do, and we implemented approach two described in the following blog post but the important thing is that we added one extra feature.

In approach #2 of Nagaraju's blog he modifies the output directory by adding an <ItemGroup> in the build script and writes the output to that directory in the After Compile Target Group. The problem with this solution is that the list of file in the ItemGroup is being initialized before the solution is being build. Therefore when your solution output changes the build will not pick this up the first time around. (This is a common "issue" with listing files in itemgroups, many have been tricked into this problem before)

By creating the ItemGroup at runtime (using an CreateItem task) this problem will not occur. Here's how you do just that:

<CreateItem Include ="$(SolutionRoot)\**\bin\$(VS2003_Configuration)\**\*.*">
<Output ItemName ="VS2003_OutputFiles" TaskParameter="Include"/>
</CreateItem>

The complete build script will look like this:

<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)\Your .Net1.1 Solution.sln&quot; /build $(VS2003_Configuration)" />
<CreateItem Include ="$(SolutionRoot)\**\bin\$(VS2003_Configuration)\**\*.*">
<Output ItemName ="VS2003_OutputFiles" TaskParameter="Include"/>
</CreateItem>
<MakeDir
Directories="$(BinariesRoot)\$(VS2003_Configuration)"
Condition="!Exists('$(BinariesRoot)\$(VS2003_Configuration)')" />
<Copy SourceFiles="@(VS2003_OutputFiles)"
DestinationFiles="@(VS2003_OutputFiles->'$(BinariesRoot)\$(VS2003_Configuration)\%(RecursiveDir)%(Filename)%(Extension)')"/>
</Target>

Of course it would be better not to build .NET 1.1 code anymore and just upgrade your projects to a newer version of the .NET framework. From our .NET build jungle Olav and I wish you happy coding...

- Permalink -

  1. hi,thanks for sharing it.


    krishna    2017-02-04 13:54    #
Name
E-mail
http://
Message
  Textile Help