title: How can I find the url of Team Foundation Server in Visual Studio?
body: <p>My project in VS is connected to VS Portal. 
  I'm going to add work items programmatically using C#. 
  Here is the snipped of code:</p>
  
  <pre><code>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);
              }
           }
        }
  </code></pre>
  
  <p>What is my TfsUrl? I have app.config file where I specify TfsUrl and TeamProject credentials. I tried to use TfsUrl as '<a href="http://account.visualstudio.com" rel="nofollow">http://account.visualstudio.com</a> but it didn't work. When I go to Team menu I see 'Disconnect from Team Foundation Server", so it means I'm connected now. Please help me. </p>