title: Occured exception during TFS build: TF30063: You are not authorized to access
body: <p>I created custom build activity in my TFS build template. In that custom activity I added some code which purpose is to connect to TFS read last build number, create custom number and set new number to TFS.</p>
  
  <p>To connect to TFS I am using following code:</p>
  
  <pre><code>NetworkCredential netCred = new NetworkCredential("username", "password");           
  TfsTeamProjectCollection server = new TfsTeamProjectCollection(new Uri("https://someproject.visualstudio.com/DefaultCollection")), netCred);
  server.Authenticate();
  </code></pre>
  
  <p>That code works properly when I tried to execute from my local computer in some sample console application. But when I tried to execute that code during TFS build it throw exception.</p>