kamagra how much to take

Iterating Build Definitions (IBuildDefinition) In TFS – Blocked File Error

When programmatically iterating build definitions in TFS (IBuildDefinition), with code similar to the following (at least, under the same constructs):

  1. TeamFoundationServer tfsServer = TeamFoundationServerFactory.GetServer(sTFSName);
  2. IBuildServer buildServer = (IBuildServer)tfsServer.GetService(typeof(IBuildServer));
  3. IBuildDefinition[] buildDefinitions = buildServer.QueryBuildDefinitions(sTeamProjectName);
  4. foreach(IBuildDefinition build in buildDefinitions)
  5. {
  6. // do stuff
  7. }

You may encounter the following error:

The file you are attempting to save or retrieve has been blocked from this Web site by the server administrators.

To get around this problem, you are going to have to pass some credentials into the TeamFoundationServer constructor.

This can either be done with implicit Windows credentials:

  1. TeamFoundationServer tfsServer = new TeamFoundationServer("http://tfsserver:8080", System.Net.CredentialCache.DefaultCredentials);

or it can be done with explicit credentials:

  1. TeamFoundationServer tfsServer = new TeamFoundationServer("http:// tfsserver:8080", new NetworkCredential("user", "password", "domain"));
Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>