从 Visual Studio 2008 在 Team Build 2005 中构建报告 API
我们的商店设置了 Team Foundation 2005 服务器,但所有开发工作都是在 Visual Studio 2008 中完成的。
我想要做的是编写一个程序来检查给定构建定义的构建历史并提取测试结果可以生成 Team Build 确实无法提供的漂亮图表。
但是,我在从 TFS API 获取构建服务时遇到问题。引用 VS2008 中的 TeamFoundationClient dll 显然可以让我获得 TFS2008 客户端对象,并且 TFS2005 允许我连接,但我无法询问 2008 构建服务器服务:
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."
}
我发现了以下关于使用 2005 API 的帖子: http://notsosmartbuilder.blogspot.com/2006/12/get-build-changes- changesetdata.html
但是,BuildStore 对象不再是 2008 客户端对象模型的一部分。我可以通过任何方式访问 2005 客户端 dll吗?我可以在我的开发机器上安装带有 Team Explorer 的 VS2005,但是有更简单的方法吗?我是否还可以从 VS2008 项目中引用 2005 安装中的某些 DLL(哪个??),或者简单地在 VS2005 中开发该东西会不会那么痛苦?
我可以尝试其他替代方法吗? (BuildLoggers 在构建时收集信息并自行存储;一种解析 .trx 文件的方法(我是否提到过每个单元测试运行有多个 trx 文件?);使用 TFS 报告(尽管我们的报告服务在我们的 TFS 安装)等等?)
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?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果安装 Team Explorer 2005,则可以从 VS2008 访问所需的 DLL。但是,它们没有显示在 VS2008“添加引用”对话框中的 .NET 选项卡下,我必须在 Team Explorer 2005 的安装文件夹中浏览到它们。
我安装了 VS2005,所以对我来说,DLL 最终位于 Program Files\Microsoft 中Visual Studio 8\Common7\IDE\PrivateAssemblies\
我需要添加引用以进行构建历史记录的基本枚举和检查测试结果的 DLL 是:
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: