Reproduced TFS Getting Started Guide

Source: Internet
Author: User
Tags new set

[Address of original publication] tutorial:getting Started with TFS in VS2010

[Original publication Time] Wednesday, October, 6:00pm

Earlier this month, we released a new infrastructure configuration for TFS. This configuration facilitates the creation of TFS versions that support source management, work items, and builds (builds). This is a good opportunity to migrate your resources on the VSS (Visual Source Safe) to TFS, and you can also choose some new features. Now that the official version of VS2010 Beta2 has been released, here is an introductory guide to the system.

This article is most helpful for those who have not installed or used TFS. TFS has good support for complex environments. For example, reports, SharePoint consolidation, support across multiple domains, distributed databases, and so on. But I'm not going to talk about any of these parts here, and my goal is to help you understand why we chose TFS and how to use it. If you are a user of VSS, in future articles, I'll tell you how to migrate a VSS database to TFS.

In, each system has a separate storage space, a resource identity set, a command, and a toolset. To get the whole system working, it's like connecting a set of custom stereoscopic components together: it can be done, but it's a lot of work, and it could be a mistake in some places.

What I want more than that is a system that can integrate this work together and implement my default workflow.

This integration implements a number of very common scenarios. For example, every day I edit the source code, build the product and test it, report the bug and fix it, and cycle through it. When there is an integrated system that can fully support these workflows, then all the work can be linked together. For example, when I check in a bug fix, I would like to see the change set recorded when those bugs are resolved. (see the example below)

The basic configuration of TFS allows you to do this precisely. This is a huge improvement over simple source management. The full version of TFS will incorporate some new features, including automated testing, deployment of virtual labs, and schema validation. The following is an expanded workflow:

When you use Visual Studio Pro and Ultimate, you can choose to install these new components as needed.

There are many ways to access TFS. Developers often access it through Visual Studio. Testers can access TFS through the new test and Lab Manager (no need to install VS). If you're a project manager, you can also access TFS via the Web interface, Excel,microsoft Project, or dashboards Moss support (VS2010 's new feature). More relevant content is introduced later.

In the remainder of this article, I'll step you through how to use the basic configuration to start our first TFS project.

Getting Started Guide

Now, with a conceptual level of understanding, it's time to connect them together. Start with the steps outlined in Brian Harry's TFS article. All necessary software will be installed on your machine in the form of a default collection (creative known as defaultcollection).

Here we can connect to TFS through Visual Studio. The simplest way to do this is to use the menu "team" (You can also use the links on the start page):

Here you need to enter the server name for TFS. For example, my Windows 7 machine: Jlzb2rel. Add the server to the list by adding a button, then click Close:

Here you can select the server from the combo box, then select Defaultcollection, then click Connect:

The Team Explorer tab now has server connectivity and defaultcollection, but we don't have a TFS project that can store things:

I created a new Windows Forms project for this tutorial as a sample of our solution (file, new project, Windows Forms). If you try to add a new code project to source control, an error occurs. For example:

After you select the Add Solution to source Control menu item, you get an error message that says "No team project source control folders are available":


This error is not very intuitive (especially if the provided word items are used in TFS and in your code solution, and they are different concepts). This error means that you must create a real TFS project to contain the resources that are useful in your work. In Team Explorer, right-click your collection and select New team project:

Here I will create a TFS project for the Accounts payable system. The project will contain all the required solutions, data, etc. for the entire system. Fill out the information and click Next:

The default is the agile template, but you can also select the CMMI template. For a template type you can get more detailed instructions on MSDN. This is a good choice if you are using an agile approach (such as TDD). After selecting, click Finish.

There are various status updates during the project creation process.

After successful, click the Close button:

Team Explorer shows the project that will contain work items, builds, and source code control:

You can update the project collection at this time. Add a solution to TFS: Right-click the project in Solution Explorer and select Add Solution to Source control:

You can create a new folder for your solution in TFS or simply take the default value. If you are ready, click OK.

You can see in Solution Explorer that all the files are already under source control. (See the "+" sign in front of the file)

You can now see the actions that the listed source manager can take to expose the solution. Add a comment and click Check in:

Click Yes to confirm the check-in.

At this point the new solution is in TFS, and the work item can be started.

Work Item

You can create projects directly in Visual Studio with Team Explorer or through the Web front end and the test and Lab management tools. Open Team Explorer and expand the Team queries item under work items to browse your project. You can also browse any item you can see by double-clicking any of the query options (for example, active Bugs).

Because our TFS project is empty, there are no active bugs in the list.

Create a new Bug, select Menu: Team, new project item. Here you can create a variety of work items to track function points, defects, and so on. Select Bug to continue:

Fill in the relevant information for this new bug, and then click Save Project to submit it to the database.

If you refresh the active bug query list now, you will see this new bug:

Now add a real bug to fix our project. In my case, I just created a default Windows Forms application. To update the title:

Now we need to fix this bug. Go back to Solution Explorer, select Form1.cs, and select Check out for editing:

Click the "Check Out" button to determine:

Now there's a tick mark next to the file so you know it's ready to be edited:

When you update the Text property of the main window, vs automatically checks out any dependent files:

While this example is a Windows Forms application, it also supports all other solution/project types. Now that we're satisfied with the code churn, select the "Pending Changes" tab at the bottom of the VS.

In this example, we fixed a bug, so click on the "Work Item" icon button:

Select the bug#6 that is used to track our header errors. We want to fix it with this check-in:

Add a comment and click Check in, then click Yes to confirm.

If you refresh bug#6, you will see that the status has changed to Resolved and the history has been updated.

Please note that the changeset (the collection of source control changes) has been automatically added to the history record.

You can continue to create and fix bugs as your project requires.

Other ways to access TFS

I mentioned earlier that there is no need to use VS to access TFS. We've had a lot of deep integration with other clients, such as Web pages and office. For example, I can easily connect to my server using the server name via the Web browser (8080 is the default port):http://jlzb2rel:8080/tfs/

Now I can browse my collections and projects. If you select the Accountspayable project that we just created, and then click the "Continue" button, you will see more information. In this example, you can find all the bugs in this system by navigating to the Work Items tab.

This is really a simple way to navigate through your project. Can be on any computer, and there is no need to install extra stuff. These operations are also supported in other software such as Excel,microsoft project. This type of access makes it easier to work with all members of the project.

At this point, you have a very useful set of tools to get the job done easily. If you're using VSS, it's just that the content is already exciting. Now you can drop this tutorial and rest will come back if you want to try some advanced properties, such as test scenarios. I will use Beta 1 to demonstrate in this tutorial .

Build support

The next typical part of the workflow is the automatic generation of products. If you follow Brian's installation instructions, you now have TFS Basic local build support on your machine. The first step is to navigate to Team Explorer, right-click on "All Build Definitions" and select "New Build Definition":

There are a series of definitions that need to be filled out, just like the property page for a code project:

Triggering the page allows us to decide when the build will start. You can choose from the following:

• Manual entries are used by default. We have to start our own build with this one.

• Continuous integration is useful when you want to have a new build every time you check in. It allows you to verify the new check-in immediately without having to wait for a lot of check-in to be mixed together before verifying.

• Rolling generation provides a way to change batches, which is handy when starting a build that takes a little time and you can't do every item.

• Gated Check-in lets you ensure that all check-in is generated before the incoming TFS. And make sure you don't create damage to other members of your project team.

• Plan to be a useful attempt to make a daily build for the entire team

You can create and use several different build definitions, allowing you to use different types of builds for different purposes.

You can view all the tags (each with a full document description on the product) when you are free. But we need to provide a location to generate a new store to address the yellow warning flag in the default build, where I created a public UNC on my machine:

You can now save the build definition to TFS. If you go back to Team Explorer, we can "queue a new build":

In the confirmation dialog box that jumps out, select queue:

This is a queued build that is displayed on the status page of my machine:

If you double-click a build in the queue, you can get the detailed status of this build:

From here you can see the warnings and errors, log files, navigate to the drop directory, and so on. For example, if you select "View Log File", you can see the script (subset) that executes the build:

If you choose to open the Drop folder link, you will be taken to our drop location:

Now anyone can choose to build to do their daily tests, or publish them to customers.

At this point you already know everything that leverages the basic configuration of TFS.

In the future I will do a tutorial on how to install a virtual lab system (part of Visual Studio flagship), enabling you to deploy complex applications to hyper-V environments and do automated testing.

To create a new TFS collection

[Note: This section is completely optional] if you like you can store all your work in one TFS. If you are a visual Source safe user, you can skip this whole section. But if you want to create a new top-level collection, it's pretty simple. The first step is to start, then the Team Foundation Management Console:

After the console starts, select Team Project collection items and click the Create Team project collection Link:

After you fill out a name for the project that you want to describe, click "Next":

Accept the default values for the data tier, and then click Next:

The TFS basic configuration does not support lab management, so go directly to the next step:

All the required data is configured here and you can choose "Verify":

This information is validated primarily for the collection to be successfully created:

When the verification is complete, click Create:

This step provides everything you need for each configuration of TFS. Click Next to complete the following:

You will see a new set of items for the default version:

Blog transfer from: Tutorial: VS2010 's TFS Getting Started Guide

[Reprint]tfs Getting Started Guide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.