Geeks With Blogs

Tim Huffam Dotting the I and crossing the T of I.T.

This is for TFS2008.

This is based mainly on this article: http://blogs.msdn.com/b/jpricket/archive/2007/08/03/tfs-2008-running-two-build-agents-on-the-same-machine.aspx
But also had input from these:
http://www.woodwardweb.com/vsts/000398.html
http://blogs.msdn.com/b/buckh/archive/2007/08/14/tfs-2008-a-basic-guide-to-team-build-2008.aspx
http://blogs.msdn.com/b/jimlamb/archive/2010/04/13/configuring-multiple-tfs-build-services-on-one-machine.aspx

Also the following article discussing upgrading a TFS2008 build server to cater for VS2010 projects: http://www.richard-banks.org/2009/11/how-to-build-vs2010-solutions-using.html

Scenario: 
---------
We want to use the existing build service the way it is - for VS2008 projects.
We will create a new build service, on the same machine but using another port -  for building VS2010/.Net 4.0 projects.
**For this we must have first installed VS2010 on the build server! (see article mentioned above).

The reason we're creating another service is that we found certain VS2008 projects would not build using MSBuild 4.0 (intended for VS2010 - but supposedly catering also for VS2008).  The main problem area was unit tests and the private accessor's VS generates (to provide access to private/internal members of a class being tested).  The following link provides a work around, but we found this just opened up more problems - and in the end decided that the multi-service solution would get us up and running quickest: http://blogs.msdn.com/b/adamroot/archive/2009/12/10/building-vs-2008-unit-test-projects-in-msbuild-4-0-beta-2.aspx


To create the 2nd build service (VS2010/.Net 4.0 projects):
-----------------------------------------------------------
1) Copy build service executable and config file (tfsbuildservice.exe & tfsbuildservice.exe.config) giving them another name
   (eg tfsbuildservice_2.exe & tfsbuildservice_2.exe.config).
   They are located within the following directory:
   <Program Files>\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies

2) Modify port setting.
   Edit the new config file (tfsbuildservice_2.exe.config) and update the following line with a new port number (eg 9193):
   <add key="port" value="9191" />

3) Make the new service use .Net 4.0 - by changing the MSBuildPath - so it references MSBuild 4 (for VS2010/.Net 4.0 projects).
   Change the following line in tfsbuildservice_2.exe.config from:
    <add key="MSBuildPath" value="" />
   to
    <add key="MSBuildPath" value="C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319" />

4) Configure URL ACLs.  Do this by running the wcfhttpconfig.exe utility in the new directory using the following syntax:
  wcfhttpconfig reserve <domain>\<user name> <port number>
  *** You must run this command as a local administrator.

5) Create the new windows service.
   Execute the following command at the command prompt - as an administrator.  Note the spaces after the equals signs.
   sc.exe create "VSTFBUILD_2" binpath= "D:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\TFSBuildService_2.exe" DisplayName= "Visual Studio Team Foundation Build Service 2 (for VS2010 and .Net 4.0 projects)" 
  *** You must run this command as a local administrator.

6) Open the new service's properties and set the account and password to run as, then start it. 
   It would also pay to set this service's startup type to automatic.

You will need to create new Build Agents to point to this new service.

HTH
Tim

Posted on Wednesday, December 1, 2010 8:51 PM C# .NET , ASP.NET , Web Development, JavaScript & CSS , Unit Testing , Dev Env, TFS, MSBuild etc , WPF & Silverlight | Back to top


Comments on this post: Creating mulitple TFS Build services on the same server - one for VS2008 projects and one for VS2010 projects

# re: Creating mulitple TFS Build services on the same server - one for VS2008 projects and one for VS2010 projects
Requesting Gravatar...
I followed the instructions and got the following error when starting the service:

The network transport endpoint already has an address associated with it.

If I turn off the 2008 server and start the 2010 service, the error goes away. If I then try starting the 2008 service, I get the same error.

There must be another place (like the registry) that stores the port number. Any ideas?
Left by Jeff Lederer on Feb 28, 2011 12:38 PM

# re: Creating mulitple TFS Build services on the same server - one for VS2008 projects and one for VS2010 projects
Requesting Gravatar...
More interesting and informative!
Left by Purex Detergent Coupons on Jul 26, 2011 3:21 PM

# re: Creating mulitple TFS Build services on the same server - one for VS2008 projects and one for VS2010 projects
Requesting Gravatar...
To share the truth is I'm certain rather astonished along with what you will thought to. All of us look at many inspiring suggestions, nice in conjunction with good style and design you’ve own these.
Left by Nandroid Backup on Apr 10, 2012 12:50 PM

# re: Creating mulitple TFS Build services on the same server - one for VS2008 projects and one for VS2010 projects
Requesting Gravatar...
Thanks, I have a new tfs project that I want to run on the same server. This will be useful for that.
Left by Maria on Apr 14, 2013 2:36 PM

Your comment:
 (will show your gravatar)


Copyright © Tim Huffam | Powered by: GeeksWithBlogs.net