In my last post I covered how to install TFS 2010 Beta 2 so in this post I’m going to go through the process of adding a new project into TFS.
Apologies in advance for the length of this post but it’s mostly screenshots and the whole process from start to finish took no longer than 30 minutes. I’m really impressed with just how easy it all was.
Creating a new collection
TFS groups projects into collections and when you first install TFS it creates a default collection for you. Not wanting to be stuck with the default my first step was to create a new collection to house my projects in. To do this you will need to open the TFS Administration Console on the server, in this case the Windows 7 machine I had installed TFS onto.
At the top right of the screen you will see a link which says “Create Team Project Collection” and once you click on that link you will enter a wizard for creating a new collection.
The first step is to give your collection a name and description.
Clicking “Next” will allow us to setup the collection database, in this case I'm creating a new database on the SQL Express instance installed on my virtual machine.
Clicking “Next” we are now asked whether we want to configure lab management for the collection. Because I didn’t enable lab management on my TFS server I just moved to the next step here.
Now you can review the settings for your new collection and if you’re happy click on the “Verify” button which check the configuration information is all ok.
Finally after the verification is finished you can click on the “Create” button and watch TFS create your new empty collection.
Now you have the default collection and your shiny new collection to put all of your projects in.
Connection to TFS 2010 in Visual Studio 2010
After creating the collection we have to connect Visual Studio to TFS so the first thing to do is open up Visual Studio and look for the “Connect to Team Foundation Server” option in the top left just under the Visual Studio 2010 logo.
The resulting pop up window has a drop down list which is filled with the servers currently registered with Visual Studio. When you pick one of those servers the collections available on that server will populate the left hand side of the dialog and on selecting a collection it’s projects will appear on the right hand side. At the moment we have no servers so we need to register a new one.
When you click on the “Servers” button in the top right you are shown a list of servers currently registered.
As this list is currently empty we need to click on the “Add” button. If you have used the default setup all you should have to do now is enter the name of your TFS machine and click “OK”.
Your server should now appear in the server list which you can close.
On closing the server list we are back to where we started but now our TFS instance is listed and we can see the collections on the server. Click on the collection you would like to connect to and the press the “Connect” button.
Adding a Project to a Collection
Now we have our empty collection and Visual Studio has been connected to TFS so the next step is to add a project into our collection so we can get to work. To do this we need to open up Team Explorer which you can find under the “View” menu in Visual Studio.
To add your project right click on the name of your server and collection, in this case sidebytetfs\Sidebytes and then select the “New Team Project” option. Up pops yet another wizard and the first step is to give your project a name and description.
Next we select a process template, I’m going for Agile.
Next up source control options, I’m creating a new source control folder but you can also create a new branch from an existing repository.
Review all of your settings and finish the wizard.
In team explorer you should now see project you have just created.
Adding source code to a TFS project source control
Now we have our project in TFS we need to add our code to it’s source control repository. If you are adding existing code into source control then open up the solution and then right click on the solution in the solution explorer selecting the “Add Solution to Source Control” option. If you are adding a new project tick the “Add to source control” option at the bottom right of the new project dialog.
Up will pop a dialog which lists the projects inside the TFS collection you are currently connected to. Select the project you would like to associate the source with and then give it a folder name.
Your project will now be added to source control and you should see a list of pending changes which are still to be committed to the repository.
Select the “Check In” option and all of your files will be pushed back to the repository leaving your solution now under source control.
Web Access
As a quick aside TFS 2010 now comes with a full featured web interface where you can access your source control, work items etc.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5