从Visual Studio 2008在Team Build 2005中构建报表API

时间:2023-01-16 21:55:52

Our shop is set up with a Team Foundation 2005 server but all development work is done in Visual Studio 2008.

我们的商店设置了Team Foundation 2005服务器,但所有开发工作都在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.

我希望能够做的是编写一个程序来检查给定构建定义的构建历史,并提取出测试结果,以生成Team Build实际上没有给出的那种排序的漂亮图形。

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:

但是,我无法从TFS API中获取构建服务。在VS2008中引用TeamFoundationClient dll显然可以获得TFS2008客户端对象,而TFS2005允许我连接,但我无法查询2008 Build Server服务:

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

我在使用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?

但是,BuildStore对象不再是2008客户端对象模型的一部分。我可以以任何方式访问2005客户端dll吗?我可以在我的开发者机器上安装团队资源管理器获得VS2005,但是有更简单的方法吗?我是否也可以从VS2008项目中引用2005安装中的某些DLL(哪些??),或者在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?)

我可能尝试的其他任何替代方法? (BuildLoggers在构建时收集信息并自行存储;解析.trx文件的方法(我是否提到每单元测试运行时有多个trx文件?);使用TFS报告(尽管我们的报告服务已被打破)我们的TFS安装)等?)

1 个解决方案

#1


0  

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.

如果安装了Team Explorer 2005,则可以从VS2008访问所需的DLL。但是,它们没有出现在VS2008添加引用对话框的.NET选项卡下,我不得不在Team Explorer 2005的已安装文件夹中浏览它们。

I had VS2005 installed, so for me the DLLs ended up in Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\

我安装了VS2005,所以对我来说DLL最终出现在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:

我需要为构建历史的基本枚举和检查测试结果添加引用的DLL是:

  • Microsoft.TeamFoundation.Client
  • Microsoft.TeamFoundation.Client
  • Microsoft.TeamFoundation.Common
  • Microsoft.TeamFoundation.Common
  • Microsoft.TeamFoundation.Build.Client
  • Microsoft.TeamFoundation.Build.Client
  • Microsoft.TeamFoundation.Build.Common
  • Microsoft.TeamFoundation.Build.Common

#1


0  

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.

如果安装了Team Explorer 2005,则可以从VS2008访问所需的DLL。但是,它们没有出现在VS2008添加引用对话框的.NET选项卡下,我不得不在Team Explorer 2005的已安装文件夹中浏览它们。

I had VS2005 installed, so for me the DLLs ended up in Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\

我安装了VS2005,所以对我来说DLL最终出现在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:

我需要为构建历史的基本枚举和检查测试结果添加引用的DLL是:

  • Microsoft.TeamFoundation.Client
  • Microsoft.TeamFoundation.Client
  • Microsoft.TeamFoundation.Common
  • Microsoft.TeamFoundation.Common
  • Microsoft.TeamFoundation.Build.Client
  • Microsoft.TeamFoundation.Build.Client
  • Microsoft.TeamFoundation.Build.Common
  • Microsoft.TeamFoundation.Build.Common