How to check in files from local folder to TFS programatically ??


can me how checkin set of files (especially *.dll files) tfs local folder not mapped locally.actually having requirement set of projects once build created in build server have update output of build common assemblies folder in tfs.where assemblies used various applications.here using tfs 2010 build definition build automation.


working developer in asp.net 2.0

i have figured out this  below code.by creating custom activity.

tfsteamprojectcollection tfs = new tfsteamprojectcollection(new uri(tfsname)); // reference version control.               versioncontrolserver versioncontrol = tfs.getservice<versioncontrolserver>(); workspace workspace =      versioncontrol.createworkspace("tempworkspace1", versioncontrol.authorizeduser);                 // create mapping using team project supplied on command line. workspace.map(tfspath, path); context.writebuildmessage("sucessfully mapped folder " + path,      buildmessageimportance.high); // files repository.  workspace.get(); context.writebuildmessage("sucessfully binaries workspace",      buildmessageimportance.high);  string files = tfspath + "/*";  context.writebuildmessage(     "temporarily checking out files tfs path " + files,      buildmessageimportance.high);  int pendedit = workspace.pendedit(files, recursiontype.full);  pendingchange[] pendingchanges = workspace.getpendingchanges();  context.writebuildmessage(     "copying binaries droplocation- " +      buildinformation.droplocation,      buildmessageimportance.high);  copyallfiles(buildinformation.droplocation, path, false);  context.writebuildmessage("copied binaries droplocation",      buildmessageimportance.high);  workspacecheckinparameters parameters =      new workspacecheckinparameters(pendingchanges, "***no_ci***")     {         overridegatedcheckin = true,     };  int changeset = workspace.checkin(parameters);  context.writebuildmessage("checking in files workspace - " + tfspath,      buildmessageimportance.high);  // cleanup workspace. workspace.delete();       deletemappedfolder(); 


working developer in asp.net 2.0




Archived Forums V  >  Team Foundation Server - Build and release management



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........