Our shop is set up with a Team Foundation 2005 server but all development work is done in Visual Studio 2008.
What I would like to be able to do is write a program that examines the build history of a given Build Definition and extract out the test results to produce pretty graphs of the sort that Team Build really doesn't give.
However, I'm having trouble getting the build service out of the TFS API. Referencing the TeamFoundationClient dlls in VS2008 obviously gets me the TFS2008 client objects, and TFS2005 allows me to connect, but I can't interrogate the 2008 Build Server service:
TeamFoundationServer teamServer = TeamFoundationServerFactory.GetServer(m_tfsServerName);
teamServer.EnsureAuthenticated();
IBuildServer buildServer;
try
{
buildServer = (IBuildServer)teamServer.GetService(typeof(IBuildServer));
}
catch(Exception ex)
{
// Error thrown:
// System.NotSupportedException
// "TF214015: The build client object model does not support Team Foundation Server 2005."
}
I found the following post on using the 2005 API: http://notsosmartbuilder.blogspot.com/2006/12/get-build-changes-changesetdata.html
However, the BuildStore object is no longer a part of the 2008 client object model. Can I get access to the 2005 client dlls in any way? I can get VS2005 with Team Explorer installed on my developer machine, is there a simpler way however? Would I also be able to reference certain DLLs (which??) from the 2005 installation from a VS2008 project or would it be less painful to simply develop the thing in VS2005?
Any other alternative approaches that I might be able to try out? (BuildLoggers to collect the information at build time and store it myself; a way of parsing the .trx files (did I mention that we have multiple trx files per unit test run?); using TFS Reporting (although our Report Service is broken on our TFS installation) etc?)
If you install Team Explorer 2005, you can access the DLLs needed from VS2008. However, they did not show up under the .NET tab in VS2008 Add References dialog, I had to browse to them in the installed folder of Team Explorer 2005.
I had VS2005 installed, so for me the DLLs ended up in Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\
The DLLs I needed to add references to for basic enumeration of the build history and checking test results were: