Mostrando entradas con la etiqueta TFS. Mostrar todas las entradas
Mostrando entradas con la etiqueta TFS. Mostrar todas las entradas

Tfs API - Obtener items [*** 100% funcionando ***]

(fuente para el tema de autenticacion: https://stackoverflow.com/questions/3150260/how-do-you-connect-to-a-tfs-server-in-c-sharp-using-specific-credentials/3150730#3150730)

Instalar con NuGet:

* Microsoft.TeamFoundationServer.ExtendedClient (version 15) ==> agregar todo


* Microsoft.VisualStudio.Services.Client (version 15) ==> se necesita Microsoft.TeamFoundation.Common.dll


* Microsoft.TeamFoundationServer.Client.(version 15) ==> se necesita Microsoft.VisualStudio.Services.WebApi.dll


Ejemplo de uso:

static void Main(string[] args)
{
var urlTfs = "http://Xvir29:8080/tfs";
var workspaceTfs = "X00894";
var pathLocal = @"c:\crusso\X\fuentes";
var teamProject = "Desarrollo";
var usuario = "carusso";
var password = "elpassword";

GetSourceFromTFS(urlTfs, workspaceTfs, pathLocal, teamProject, "WebCreditos", usuario, password);
}



public void GetSourceFromTFS(string urlTfs, string workspaceTfs, string pathLocal, string teamProject, string proyecto, string usuario, string password)
{
var collectionUri = new Uri(urlTfs);

NetworkCredential credential = new NetworkCredential(usuario, password);

NetworkCredential netCred = new NetworkCredential(usuario, password);
var winCred = new Microsoft.VisualStudio.Services.Common.WindowsCredential(netCred);
VssCredentials vssCred = new VssClientCredentials(winCred);
vssCred.PromptType = CredentialPromptType.DoNotPrompt;

Uri tfsUri = new Uri(urlTfs);
var tfs = new TfsTeamProjectCollection(tfsUri, vssCred);         
tfs.EnsureAuthenticated();


var vsStore = tfs.GetService<VersionControlServer>();

var path = pathLocal + "\\" + teamProject + "\\" + proyecto;
var items = vsStore.GetItems("$\\" + teamProject + "\\" + proyecto, VersionSpec.Latest, RecursionType.Full);

var workspace = vsStore.GetWorkspace(workspaceTfs, usuario);

workspace.Get(new string[] { path }, VersionSpec.Latest, RecursionType.Full, GetOptions.GetAll);
}



Eliminar un Team Project

En versiones anteriores a 2008 la funcion tf destroy no esta disponible.

Para poder eliminar definitivamente un team project y limpiar la base de datos:

1. Ir a consola de visual studio (2008 o 2010)

2. Ejecutar:
               tf destroy "$/nombre_del_team_project" /startcleanup 

3. Ejecutar:  
            tfsdeleteproject /server:http://servidor:8080/tfs/defaultcollection "nombre_del_team_project"











Hacer undo checkout en un workspace de otro usuario

Abrir una consola de Visual Studio

tf undo /workspace:[nombre del workspace];[usuario] /server:[url del servidor de tfs] [ruta completa del archivo]

Ejemplo:


C:\Temp>tf undo /workspace:abc10377;carusso /server:http://xyztfs:8080 $/Desarro
llo/TITOWEB/Archivo1.aspx.vb

Listar todos los archivos con checkout de un usuario

Abrir una consola de visual studio, y luego:


tf status /recursive /user:NOMBRE_DE_USUARIO /server:http://NOMBRE_SERVIDOR:8080

Utilizar TFS con MsAccess

http://blog.accentient.com/TeamFoundationServerForMicrosoftAccessDevelopers.aspx

I was invited by INETA to speak at the Pacific Northwest Access Developer Group (a.ka. the Seattle Access Group). Now, Access developers are typically "teams of one", but I thought that any team developers or consultants attending the meeting would get the ALM story and features of TFS. They did.f
As it turns out, the steps to integrate Microsoft Access 2007 with TFS aren't all that difficult:
  1. Install and configure TFS to allow the developers to connect
  2. Install the MSSCCI provider on each developer's desktop
  3. Install the Access Developer Extensions on each developer's desktop
  4. Create and configure the Team Project, version control folders, and workspace(s)
  5. Follow the guidance on using Access with Source Control (you can ignore the references to VSS).
Remember: you can't View, Compare, or Annotate any Access objects under source control, with the exception of code (modules, macros).
Thank you to those of you who attended my talk. You can download my presentation here.