March 2009 - Posts

Setup of CruiseControl.NET with TFS 2005 under a 64bit server

I installed CC.NET under TFS for enable build server for continuous integration. This is my experience…

Used Tools:
CruiseControl.NET (Versione 1.4.2.14) CC.NET
Plugin per CC.NET per TFS (http://www.codeplex.com/TFSCCNetPlugin)
Client TFS Explorer TFS 2005
CC Tray (Client Windows for CC.NET)

Download and install CC.NET (remember version info). Later download plug-in for TFS integration with CC.NET from Codeplex. The only operation required is copying DLL into CC.NET install folder (server). This tool manage getting latest version from TFS.
Later we must change CC.NET configuration file.This is an example:
<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
<project>
<name>Devenv project</name>
<triggers>
<intervalTrigger seconds="60"/>
</triggers>
<modificationDelaySeconds>60</modificationDelaySeconds>
<sourcecontrol type="vsts" autoGetSource="true" applyLabel="true">
<server>http://tfsserver:8080</server>
<project>$/Casillo.SOA</project>
<username>user</username>
<password>password</password>
<domain>mydomain</domain>
</sourcecontrol>
</project>
</cruisecontrol>
In the <sourcecontrol> section we indicate all information about connection to TFS. I used Reflector too because I wanted see all option of this DLL…it uses attributes for map informations.
In my experience I used a 64bit server, in this case we need to force CC.NET for to be execute in 32 bit context. We can do this using this command:
corflags.exe 32bit+ ccnet.exe
from VS 2008 command prompt.
After we need to download TFS 2005 Cliente Explorer, because we will use some DLL for access to TFS. After unzip TFS 2005 client .img file (I used a freeware program called ExtractNow).
Some DLL need to installed under GAC (gacutil /i file.dll under VS command prompt):
Microsoft.TeamFoundation.Client.dll
Microsoft.TeamFoundation.Common.dll
Microsoft.TeamFoundation.Common.Library.dll
Microsoft.TeamFoundation.dll
Microsoft.TeamFoundation.VersionControl.Client.dll
Microsoft.TeamFoundation.VersionControl.Common.dll
Microsoft.TeamFoundation.VersionControl.Common.Integration.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.Cache.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.DataStore.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.Provision.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.QueryLanguage.dll
Microsoft.TeamFoundation.WorkItemTracking.Client.RuleEngine.dll
Microsoft.TeamFoundation.WorkItemTracking.Proxy.dll

Now you can use CCTray client for connect to CC.NET. It will work if everything is ok. Now we need to configure CC.NET for build our projects. We can do this using MSBuild, the official building tool from Microsoft used by Visual Studio (pay attention to correct version of MSBuild for .NET Framework 2.0,3.0 or 3.5).
This is a complete example from my experience:
<project>
<name>Example1</name>
<triggers>
<intervalTrigger seconds="240"/>
</triggers>
<modificationDelaySeconds>120</modificationDelaySeconds>
<sourcecontrol type="vsts" autoGetSource="true" applyLabel="true">
<server>http://tfs:8080</server>
<project>$/CA.Example1</project>
<username>user</username>
<password>pwd</password>
<domain>mydomain</domain>
<workingDirectory>C:\WorkingDirectory\example1\</workingDirectory>

</sourcecontrol>
<tasks>
<msbuild>
<executable>C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
<workingDirectory>C:\WorkingDirectory\example1workingDirectory>
<projectFile>Example1.sln</projectFile>
<buildArgs> /p:Configuration=Debug</buildArgs>
<targets>Build</targets>

</msbuild>
</tasks>
<publishers>

</publishers>
</project>

I used to build debug configuration and no prebuild or post build task.CC.NET support post build tasks and some other things, you can do the same with VS pre build and post build tasks if you want.
Have fun!
Antonio

This site

Search

Go

This Blog

Syndication

Sponsors

  • MaximumASP
  • Social Bookmarking
    Online Shopping
    asp.net hosting
    UK online local dating