如何确定之前 TFS 构建期间使用的自定义参数和值? [英] How to determine the custom parameters and values used during a previous TFS Build?
本文介绍了如何确定之前 TFS 构建期间使用的自定义参数和值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何确定在 TFS 构建期间使用的自定义参数值?
How can one determine the custom parameter values that were used during a TFS build?
推荐答案
您可以通过使用 TFS API 来实现,请查看以下代码:
You can achieve that via using TFS API, check the following code:
TfsTeamProjectCollection tfctc = new TfsTeamProjectCollection(new Uri("http://tfsservername:8080/tfs/DefaultCollection"));
IBuildServer bs = tfctc.GetService<IBuildServer>();
IBuildDetail[] builds = bs.QueryBuilds("teamprojectname", "builddefinitionname");
foreach (var build in builds)
{
var buildefinition = build.BuildDefinition;
IDictionary<String, Object> paramValues = WorkflowHelpers.DeserializeProcessParameters(buildefinition.ProcessParameters);
string processParametersValue = paramValues["argument1"].ToString();
Console.WriteLine(processParametersValue);
}
这篇关于如何确定之前 TFS 构建期间使用的自定义参数和值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文