0
我试图运行这个,但控制台应用程序运行并关闭。TFS API控制台应用程序打开和关闭
我猜查询是拉空白或空,但我确保有一个活跃的工作项目。
我只是试图让它在这一点上拉回任何东西。
try
{
TfsTeamProjectCollection teamProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://(server):8080/tfs/DefaultCollection"));
var workItemStore = (WorkItemStore)teamProjectCollection.GetService(typeof(WorkItemStore));
// Sample query string.
string wiqlQuery = "SELECT System.ID, System.Title from workitems ";
// Execute the query.
WorkItemCollection witCollection = workItemStore.Query(wiqlQuery);
// Show the ID and Title of each WorkItem returned from the query.
foreach (WorkItem workItem in witCollection)
{
Console.WriteLine("ID: {0}", workItem.Id);
Console.WriteLine("Title: {0}", workItem.Title);
Console.Read();
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
Console.Read();
}
检查是否已设置了该项目作为一个控制台应用程序,而不是一个Windows应用程序。 – Aron
我该如何检查?当我去属性时输出说控制台应用程序。 – Sewder
使用调试器? –