我在VS中的项目已连接到VS Portal。 我将使用C#以编程方式添加工作项。 这是剪辑代码:
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;
namespace CSTFSWorkItemObjectModel
{
class Program
{
static void Main(string[] args)
{
var tfsUrl = ConfigurationManager.AppSettings["TfsUrl"];
var tfs = TeamFoundationServerFactory.GetServer(tfsUrl);
// WorkItemStore instance.
var wis = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
// Read project name form the application configuration file
var projectName = ConfigurationManager.AppSettings["TeamProject"];
EnsureWITImported(wis, projectName);
var project = wis.Projects[projectName];
var id = CreateWorkItem(project);
var wi = GetWorkItem(wis, id);
EditWorkItem(wi);
QueryWorkItems(wis, projectName);
Guid queryGuid = EnsureWIQueryCreated(wis, project);
QueryWorkItemAsynchronously(wis, queryGuid, project);
}
}
}
我的TfsUrl是什么?我有app.config文件,我在其中指定TfsUrl和TeamProject凭据。我尝试使用TfsUrl作为' http://account.visualstudio.com,但它没有用。当我进入Team菜单时,我看到'断开与Team Foundation Server的连接",这意味着我现在已连接。请帮我。
答案 0 :(得分:1)