Monthly Archives: March 2012
Brian Harry just announced that we have added cloud-hosted build servers to our cloud-hosted TFS (Team Foundation Services). I would suspect that in most organizations build servers sit idle most of the day, receive very little love as far as maintenance, updates, etc. I think this is a fantastic use of our Azure offering.
Read Brian’s post here.
If you are reading this post, you are likely a software developer and the first thing you want to do after establishing a connection to Team Foundation Service is to set up your code in source control. In this post, I will walk you through how to get your code into source control and establish a good foundation for a branching strategy.
- Now that we have a connection to TFS, let’s create a new project and get it into source control! From the File menu, hover over New, and then select Project…
- It doesn’t matter what project template you choose, but let’s create a WPF application for this. When the New Project dialog appears, look through the installed project templates on the left. Under Installed, Templates, Visual C#, select Windows. In the middle pane, select WPF Application. You can leave the defaults for everything else, but be sure to check the box labeled Add to source control. Click the OK button to create the new solution.
- The Add Solution WpfApplication1 to Source Control dialog box appears so you can choose where you want to save your application up in Team Foundation Service. Select the team project you wish to use (you likely only have one at this point).
- Click the Make New Folder button and enter a name to represent your or your team of developers. I like to enter the name of the team that will own the software first. (In my case, this will be our community “GiveCamp” team.) We will revisit this again in an upcoming blog post about teams in Team Foundation Service.
- Click the Make New Folder button again and enter the name of the software product or component you will be developing. (I’m not feeling very creative so I’m just going to enter “WpfApplication1”.) This is the name of our new software application and this folder will act as the parent folder for our branches.
- Click the Make New Folder button one last time and enter “MAIN”. This folder represents the root branch of our application.
- Leave the other fields with their default values and click the OK button to map your local copy of the new solution to its counterpart up in Team Foundation Service.
- Now, let’s open Source Control Explorer so we can see our files from the perspective of the server. From Visual Studio’s main menu, select View, Other Windows, and then select Source Control Explorer.
- Right-click the folder representing your team (“GiveCamp” for me) and, from the context menu that appears, select Check In Pending Changes.
- Your cursor should be focused on the Team Explorer window which has changed to the Pending Changes view. Enter a comment for your check-in like “Initial setup of solution”.
- Click the Check In button (just above the Comment field). Click the Yes button if you are prompted to confirm your check-in.
Congratulations! You now have code under source control in your area of the cloud. You can continue to make changes to the application in order to get more comfortable with checking out/in code.
If this is your first exposure to source control – WELCOME! Source control is an essential tool of software development – whether you are a large corporate team or a lone developer. While it is a very complex topic, I’ve provided my take on some basic vocabulary below:
- Getting latest – Before you edit code in source control, you should probably be sure you are working with the latest version of the code. We call that “getting latest” because you are retrieving any changes to the code from the server.
- Checking out – This marks the files so others can see you are making changes to them. It doesn’t mean they can’t make changes to the same file, but remember your edits are local only at this point and they can’t see what work you’ve done until…
- Checking-in – This action commits your changes to the source control for server.
That’s all for now. We’ll talk about setting up a team to collaborate with next.
Connecting Visual Studio to Team Foundation Service
For this effort, I will be utilizing Visual Studio 11 Beta which you can download here. If you wish to use Visual Studio 2010, be sure you have installed the hotfix here. Although your 2010 screenshots will differ slight, the steps are the same for either version of Visual Studio. (If you haven’t set up your team project in Team Foundation Service, see my previous post: Getting Started With Team Foundation Service – Part 1.)
- Open Visual Studio.
- If Team Explorer isn’t already open, go to the menu bar at the top of Visual Studio, select View, and then select Team Explorer. There’s a shortcut key combination too, but it’s kinda strange so I never use it.
- Just below the Team Explorer toolbar, click the drop-down arrow at the far right. From the context menu that appears, hover over Projects and My Teams and then select Connect to Team Projects…
- When the Connect to Team Project dialog appears, click the Servers… button.
- When the Add/Remove Team Foundation Server dialog appears, click the Add… button.
- The Add Team Foundation Server dialog appears. At the top of the dialog, enter the URL to your Team Foundation Service and click the OK button.
- If there were no issues connecting, when you return to the Add/Remove Team Foundation Server dialog, you should see your server listed. Click the Close button.
- Be sure your server is selected in the dropdown list and your team project collection is selected on the left pane of the Connect To Team Project dialog. Put a checkbox next to one or more team projects on the right and click the Connect button.
Now, that you have connected Visual Studio to Team Foundation Service, you are able to create work items, setup automated builds, and utilize all of the other cool features! In my next post, we’ll talk about finally getting some code up there!
The Microsoft Visual Studio Team Foundation Service Preview is available. It is important to note the name is Team Foundation Service and not Team Foundation Server. The Team Foundation Service is Team Foundation Server hosted by Microsoft in Azure. For now, what you get is all of the source control and work item goodness you’d get with an on-premises Team Foundation Server and it’s accessible from anywhere you get internet access. Additionally, this is a cloud-based service which means someone else is taking care of the tedious stuff I hate (and therefore never do): backups, updates, networking, security, etc. Speaking of updates, because this is a cloud-based application, we should expect to see some new features rolled out here before they are available for your on-premises Team Foundation Server. If you are interested in obtaining your own team project collection in the cloud, go here or find someone who can send you an invite to theirs.
As you get started with Team Foundation Service, your first task will likely be creating a new team project. After this, you can “upload” your source code and start creating work items.
- Navigate to your Team Foundation Service Welcome Page. You should have received a URL when you signed up for your account.
- Under GETTING STARTED header, click the Create a team project hyperlink.
- In the CREATE NEW TEAM PROJECT dialog, enter a brief name in the Project name field. Optionally, enter a longer summary of the team project in the Description field. In the Process template drop-down list, choose a process to utilize on this team project.
- Click the Create Project button to start the creation process. It may take a minute to complete.
I really like the ease of jumping into a hosted Team Foundation Server. In future posts, I’ll talk about some other advantages of the Team Foundation Service. Have you tried it? What do you think?