如何在Visual Studio中找到Team Foundation Server的URL?

时间:2016-08-23 00:52:02

标签: c# visual-studio visual-studio-2015

我在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的连接",这意味着我现在已连接。请帮我。

1 个答案:

答案 0 :(得分:1)

  1. 点击“团队菜单”
  2. 选择"连接到Team Foundation Server ..."
  3. 在团队资源管理器窗口中,单击"选择团队项目..."
  4. 在对话框中,单击"服务器..."按钮。