Friday, November 1, 2013

Understanding Visual Studio 2013 and TFS - Projects vs Team Projects

As a developer, I left the Microsoft stack back in 2000 and am very excited to return to the fold with a cutting-edge, large scale One ASP.Net / MVC 5 app. As I am reorienting myself to the Visual Studio 2013 environment, I am learning some things that other new users might find useful.

Visual Studio Solutions and Projects
According to Microsoft, a Project in Visual Studio is "used in a solution to logically manage, build, and debug the items that make up your application... A solution includes one or more projects, plus files and metadata that help define the solution as a whole. Visual Studio automatically generates a solution when you create a new project. " [1

A project groups files for an app and a solution groups projects.

Team Foundation Service (TFS) and Team Foundation Server (also TFS)
TFS is Microsoft's answer to version control, but it is also a tool for project planning and build automation. MSDN Blogger Steve Lange has a great post on the differences between Team Foundation Server and Team Foundation Service that includes a handy PowerPoint brief summarizing the service features. In a nutshell, the service is a cloud based version of the locally hosted server. Microsoft provides the Team Foundation Service free for the first 5 users, so it is well worth checking out.

TFS Team Project
Visual Studio Project and a Team Project are completely different groupings. Reuse of the name is very confusing and, in fact, is what motivated me to create this blog post.  An Article on TFS in MSDN Magazine dated April 2011 describes a team project as a “container for artifacts, including source code (organized into folders, branched folders and branches) and containing one or more Visual Studio solutions, Team Build configuration files, Team Load Test Agents, an optional SharePoint repository containing the pertinent documents for the project…” In other words, a team project is a source control container for one or more Visual Studio solutions. [2]

A TFS team project groups Visual Studio solutions. In this diagram, a new "Web Application" as created in Visual Studio would be a project that is part of a larger solution, which is checked into a team project repository.

TFS Collection
A TFS Collection is a group of Team Projects. The default collection created when you first register with TFS is called DefaultCollection… Unfortunately, with the Team Foundation Service provided with Visual Studio only one collection is allowed per account. [3] If you are running a Team Foundation Server, it is possible to create multiple collections.

A collection groups team projects. (Multiple team projects as pictured above are not possible in the Team Foundation Service provided with Visual Studio.)

What is a workspace and how does it fit into this picture? “Your workspace is a local copy of your team’s codebase.” [4] It is where you actually work on the code.

Local Workspaces vs Server Workspaces
When tying your workspace to your Team Project, you have the option to work locally, which copies all files from the repository, or you can work in server mode, which only copies files one at a time.  (The MSDN article titled “Decide between using a local or a server workspace” has a great explanation of why this would be desirable.)

Team Project Settings: Speed Server Workspaces with Asynchronous Check-in
“You can reduce the time the system takes to check out files to server workspaces by selecting Enable asynchronous checkout in server workspaces. If you select this option: The PendChange permission is no longer enforced [and] Checkout locks are disabled.” [5]

No comments:

Post a Comment