📜 ⬆️ ⬇️

Work with Visual Studio Team Foundation Server 2010


This article will be useful to those who have not installed or used Visual Studio Team Foundation Server before. TFS can be part of a very complex infrastructure that includes reports, integration with SharePoint, multiple domains, distributed databases, etc., but I’m not going to address these areas. My main task is to help deal with the basic elements of TFS (version control system, system for tracking errors and tasks, and automatic assembly system) and start using this system.


Foreword


First, let's look at why Team Foundation Server? TFS is designed to integrate development tools for faster and more comfortable work. You can integrate different systems together:

Visual Studio Team Foundation Server 2010 Image 1
')
In this case, each system has its own data warehouse, its own set of identification data, its own commands and tools. Of course, this is possible, but when working with such a system it will take a lot of time to switch between components and support.

TFS is a system that integrates all the necessary components together.

Visual Studio Team Foundation Server 2010 Image 2

This integration covers the most common scenarios. On a typical day, I will add and edit the source code, build the builds, test them, log errors found and correct them. When the entire workflow occurs in a single integrated environment, each of the elements of the process can be connected. For example, if I copy files to the repository, in which I have corrected the error, then I immediately want to make a note about this in the report. TFS, installed in the “Basic” configuration, allows you to do everything described above. The full version of TFS includes: automated testing, deployment of a virtual lab, and application architecture verification:

Visual Studio Team Foundation Server 2010 Image 3

Depending on the need, you can use only part of the components.

There are many ways to access TFS functionality. If you are a programmer, then you will probably feel comfortable using Visual Studio. If you are a tester, you can use the new Team Explorer as a client, without having to install Visual Studio. If you are a project manager, you can access information through a web browser or Excel, Microsoft Project, or even MOSS.

Install TFS 2010


Looking ahead, I will say that this process has become as simple as ever. Therefore, I decided not to publish detailed installation instructions (if I encounter problems with the installation, I recommend reading the article Installing Visual Studio Team Foundation Server 2010 ), and confine myself to theoretical knowledge.
Consider the main advantages offered by the new version of TFS.

1. Requirements - the most important restrictions that were historically passed from version to version were eliminated.


2. Installation . Installing TFS has been the sore point for many years. Now this flaw has become a virtue. The TFS 2010 installer has three installation modes: Basic, Standard and Advanced. Especially big breakthrough made in “Basic” mode. In fact, this mode turned into an installation according to the Next -> Next -> Next principle, which allows you to install and configure TFS 2010 in 20 minutes or even less (provided that the computer already has .NET 4.0 and MSSQL Express). The “Basic” mode allows you to automatically install and configure IIS (if it is not already installed), MSSQL Server (if it is not already installed) and install and configure TFS 2010 itself. The biggest trouble in this process is that after installing .NET 4.0 need to restart the computer. But trust me, the result is worth it!

After installing TFS in “Basic” mode, you get: a version control system, an error tracking system and an assembly automation system (continuous integration is easier than ever!). For the complete set there are not enough components: SharePoint and reporting systems. These items are in “Standard” mode. Another good news is that you have already installed TFS 2010 “Basic” and now you can simply add components as needed, without completely reinstalling the system.

Version Control System in TFS 2010


And so, after you have gained enough theoretical knowledge and installed TFS 2010, it's time to get to work. In this chapter, I will discuss the basics of using the version control system that TFS 2010 provides.

It is assumed that you already have TFS 2010 installed on your computer and have Visual Studio 2010.

And so, the first thing we need to do is connect Visual Studio to TFS. To do this, use the main menu (Team) or a link on the home page:

Visual Studio Team Foundation Server 2010 Image 3

The system will ask you to specify the address of the existing TFS. In my case, my Windows 7 laptop is called dionnis-pc.

Visual Studio Team Foundation Server 2010 Image 3

Visual Studio Team Foundation Server 2010 Image 3

After this, the Team Explorer window should contain the name of the connection to the server and the DefaultCollection. But at the moment we have no one added project.

Visual Studio Team Foundation Server 2010 Image 3

In the case of singing, for example, I use the Enterprise Library code, but in fact, it could be limited to a standard application (File, New Project, Windows Forms). If you now try to add a project to the repository of the version control system, Visual Studio will give an error:

Visual Studio Team Foundation Server 2010 Image 3

Visual Studio Team Foundation Server 2010 Image 3

Error means that you need to create a project in TFS, which will be all the components necessary for your work. And so, we first need to create a new project:

Visual Studio Team Foundation Server 2010 Image 3

In the next dialog box, you must specify the project name and a brief description of it:

Visual Studio Team Foundation Server 2010 Image 3

Now Visual Studio asks you to specify the methodology that we will use when developing our application. The default is Agile (flexible development methodology), but you can also choose CMMI. For more information on methodologies, I recommend reading MSDN. I recommend to stop on Agile if you do not know what exactly is suitable for you or if you use one of the flexible development methodologies (for example, TDD).

Visual Studio Team Foundation Server 2010 Image 3

Visual Studio Team Foundation Server 2010 Image 3

Visual Studio Team Foundation Server 2010 Image 3

Visual Studio Team Foundation Server 2010 Image 3

And so, finally, Team Explorer displays the elements of the current project: Work Items, Builds, and Source Control.

Visual Studio Team Foundation Server 2010 Image 3

Now you can add your project to the repository.

Visual Studio Team Foundation Server 2010 Image 3

Now you need to specify the folder in which our data will be stored.

Visual Studio Team Foundation Server 2010 Image 3

Upon successful completion of the work, Solution Explorer will mark files that claim to be placed in the repository with a “+” symbol. You will also see a list of actions that must be performed in order to place your application in the repository. Just add a comment and click Check-In:

Visual Studio Team Foundation Server 2010 Image 3

The process of adding files to the repository must be confirmed:

Visual Studio Team Foundation Server 2010 Image 3

And so, congratulations! You have added your project to the repository!

TFS 2010 bug tracking system


After we figured out how to work with the version control system, it's time to consider the principle of how the error tracking system works.

The error and task entries in Visual Studio are related to work items. You can create one of the types of work items directly from the Team Explorer panel in Visual Studio. The same can be done using the web interface or the tools of Visual Studio Test and Lab Management. In our case, I use the Team Explorer panel:



Since we have just begun work on the project, there should be no entries in the list.



Let's add an error message:





Now if you update the list of errors, you can see the newly created record.



Let's now add a more real error message.



Now it is necessary to correct the error. To do this, download the file from the repository for editing:



If everything went smoothly, then the file will contain a mark about accessibility for editing.





After editing, the Pending Changes panel in Visual Studio will show the list of files that have changed.



Since we fixed the error, you need to make a note about it:



Once you have noted the corrected error and added a comment, you can safely copy the files to the repository:





You can now verify that the error status has been changed and obtain additional information about the details of the fix.



Another way to work with TFS

You can access the project work items using the web interface. To do this, simply use the address of your server:







This method may be most effective for people who are not used to working with Visual Studio. It is also possible to use Excel and Microsoft Project.

Build in TFS 2010


For a complete (minimum) set, all that is needed is to learn how to work with assemblies. This chapter of the article is intended to fight this gap.

First you need to define the assembly parameters. To do this, use the familiar Team Explorer panel in Visual Studio.





Here I want to consider a few possible parameters.

Of particular interest is the Trigger tab. On this tab, you can specify the events on the basis of which assemblies will be built:





With such a rich set of options, you can create all kinds of assemblies based on your needs.

The next important tab when setting up a build is the tab - Build Defaults. Here you must specify the folder in which the result will be placed after the assembly.



Now you can save the build parameters and make sure that it is available in the Team Explorer panel. Let's add a new build to the queue for execution.







If you double click on the assembly in the queue, you will see detailed information on the implementation.



After a while, the result will appear.



In my case, the result was not comforting, but it does not matter now. Hope you will have everything in order! This report provides detailed information about all errors and warnings that were found, so that from this report you can immediately go to the code that caused the error.

And so, we looked at the tools that TFS offers for building assemblies. You are now fully prepared to ensure a minimum life cycle for your product using TFS.

At this point I finish the article on TFS and wish you more interesting projects!
And most importantly - do not forget to enjoy programming!

If you like the article, vote for it here.

Source: https://habr.com/ru/post/90911/


All Articles