Archive

Posts Tagged ‘TFS2012 Express’

Visual Studio 2012 Update 4 RC3


Visual Studio 2012 Update 4 RC3 is out. You can downloaded from

http://www.microsoft.com/en-us/download/details.aspx?id=40263

Check out this link for the update description

http://support.microsoft.com/kb/2872520/en-us

Install instructions

  • Visual Studio
    • VS2012.4 RC.exe
  • Team Foundation Server (Choose either Web Installer or ISO Image)
    • Web Installer: tfs_server.exe
    • ISO Image: VS2012.4 RC TFS Server ENU.iso
  • Team Foundation Server Express (Choose either Web Installer or ISO Image)
    • Web Installer: tfs_express.exe
    • ISO Image: VS2012.4 RC TFS Express enu.iso
  • Visual C++ Redistributable (Choose architecture: x86, x64, arm)
    • vcredist_x86.exe
    • vcredist_x64.exe
    • vcredist_arm.exe

TFS 2012: Set Default Task Activity in the Scrum Template


There is no option to do so without modifying the Task workitem template.

  • You need to install the TFS 2012 Power Tools

http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f

  • Open Visual Studio 2012
  • Click on Open WIT from Server

image

  • Select Task to modify the Tasks template

image

  • Click on Edit on the Activity field. At this point we want to know the valid values

image

  • Select SuggestedValues and click on Edit
  • You should see a list of the valid values
  • Close all the dialogs to get back to the previous screen shot

image

  • Click on the Workflow tab
  • Right click on ToDo and click on Open Details

image

  • Click on the new Button
  • Select Microsoft.VSTS.Common.Activity from the drop down

image

  • Click on the Rules tab
  • Click on the New Button
  • Select DEFAULT

image

  • Select value from the From combobox and type Development in the Value field

image

  • Click OK to close the Default dialog
  • Click OK to close the workflow State Field Rules dialog

image

  • click the save button.

image

  • Create new Task from Visual Studio or Web Access

image

TFS2012: Run Data Driven Unit Tests in TFS Team Build


In a previous post, I explained how to run one test method twice using the data driven approach with Excel workbook as a datasource. The solution worked without issues when running using Visual Studio 2012. But I wasn’t able to run the unit tests using TFS Team build. I was getting the following error

The unit test adapter failed to connect to the data source or to read the data. For more information on troubleshooting this error, see “Troubleshooting Data-Driven Unit Tests” (http://go.microsoft.com/fwlink/?LinkId=62412) in the MSDN Library. Error details: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

image

The following is my setup:

3 VMS

Active Directory: Windows 2008 R2

TFS 2012 Express: Windows 2008 R2, SQL Server 2012 Express

Team Build Server: Windows 2008 R2, Team Build Controller and 1 Agent running as NT Authority\ Network Service

Troubleshooting Steps

Check if the Excel file is copied to the Out folder

In my case it was copied

image

Check if you have the proper drivers installed

 

In my case I had make sure that the ODBC driver for Excel xlsx files is installed. There are two versions of ODBC Datasource: 32bit and 64bit. To learn more about that topic checkout this KB http://support.microsoft.com/kb/942976

I opened both the 32bit and 64bit versions of the odbcad32.exe on the build machine and I noticed that the drivers were installed for the earlier version of Excel (xls) and not the 2007+ version (xlsx).

image

The reason it was working in Visual Studio (local machine) is I had Office 2010 installed on the machine that has Visual Studio.

I logged on as lab\administrator (domain admin rights) and then I Installed Office 2010

Now I opened the ODBCad32 and found out that the driver is installed and the DSN is added to the User DSN.

image

 

image

 

If I run the team build now, I will fail with the same error because the service is running as Network Service not lab\Administrator

Change the Run as account

Open the TFS Admin console from the build machine

Click on Build Configurations Node

Stop the Build Service

Click on Change in the Run the Service as groupbox

Select User a user account

WARNING: You MUST NOT use a domain admin for your run as service. I will change it later on in the article. The reason I am using a domain admin here is because I installed office using that account. The office installation adds the DNS names for at the user level which only accessible to the current user. I will show it to you working first then I will change the account.

Enter your username. If you keep the “User the same identity as Windows Service” checked, TFS will add this account to the Project Collection\Project Collection Build Service Accounts group. You can use a local machine admin account in the first box and a domain user with limited privileges in the Connect to TFS as box as I will show later on.

image

Click OK and Save.

Queue a team build

image

Replace Run as Service Account

Now I will replace the the run as Service Account as a local Administrator

Open the TFS admin console from the build machine

Build Configuration—>Service Property—>Stop the service

Click the change button

I am using a local admin account. If you template interact with other network computers you need to use a domain account.

image

Uncheck Use the same identity as windows Service

Click the Change button

Enter the account information. This account will be used for any interaction with TFS

image

Click and Start

Queue a new build

The build should fail with same error we had above.

image

I am getting this error because the installation of Office 2010 added the DNS name to the User DNS which means it is only available to the the current user. You can fix this issue by logging on as your new account and add the DNS to the User DNS tab.

Add Excel DNS to the Local DNS list

Log on as the new user (I am logging on as LocalAdmin). You can also run the Odbca32.exe as a different user if you don’t want of log off and on.

Open “C:\Windows\SysWOW64\odbcad32.exe”

In the User DNS

Click Add

image

Select Microsoft Excel Driver (the one that contains xlsx)

Click finish

Name it Excel Files

Click OK

Run the build again and it should pass

TFS2012: How to delete a workspace using the tf command


Today while I am writing another blog post, I encountered the following error

Exception Message: The working folder C:\Builds\5\MyTeamProject\UnitTestProject1\src is already in use by the workspace 6_5_TFS2012Build1;TFS2012BUILD1$ on computer TFS2012BUILD1. The Build Agent TFS2012Build1 – Agent1 is running as a different user Administrator and local paths can only be mapped to a single workspace. To resolve this issue, you can configure the Build Service to run as the user who owns the conflicting workspace, or you can delete the workspace using the ‘tf workspace’ command. (type WorkingFolderInUseException)

I received that error because, I changed the run as service account for the Build Controller. From a machine that has Visual Studio installed, open the VS command prompt.

Then, the first thing you want to do is check what switches TF workspace has by running the following command


tf workspace /?

To learn more about the switches or arguments, check this msdn article http://msdn.microsoft.com/en-us/library/y901w7se(v=vs.100).aspx

You can also use the tf workspaces to target multiple workspaces or to list all workspaces for a collection


tf workspaces /collection:http://tfs2012express:8080/tfs/defaultcollection Collection:http://tfs2012express:8080/tfs/defaultcollection

The above will return you the workspaces on the current machine. If you want to view all workspaces, you need to use the /computer switch


tf workspaces /collection:http://tfs2012express:8080/tfs/defaultcollection Collection:http://tfs2012express:8080/tfs/defaultcollection /computer:*

image

In my case, I am using the following switches


tf workspace /delete /collection:<a href="http://tfs2012express:8080/tfs/defaultcollection 6_5_tfs2012build1;tfs2012build1$

image

Type Yes and press enter

TFS2012 Team Build Types


In this article, I will go through the build types (triggers) the TFS Team Build supports out of the box.

What is TFS Team Build

Team build is a TFS service that is responsible for building, or compiling, your code. You can ,however, change the behavior of the process by modifying the Build Definition and the Build Process template. The Team Build Service should, ideally, be placed on a machine that is different from the TFS Server. Team Build is a resource intensive operation and placing it on the same machine as your TFS Server will degrade performance. In TFS, you can run as many builds as the number of build agents you have installed.

Build Types in TFS

Team Foundation Server 2012 supports the following build types:

Manual: The Team Build is triggered manually from Visual Studio, TFS API or tfsBuild command.

Continuous Integration (CI): Team Build is triggered whenever a new code checkin occurs. You want to use this type of build to verify the a code checkin from a developer is not breaking the build. You may want to run unit tests part of the CI to verify that the new code is not breaking any of the tested business roles.

image

Rolling Build: Rolling build is similar to CI build. It queues a build for every check in. However, it allows you to limit your build to one at a time and accumulate the checkins until the previous build is complete. Once the previous build is complete, the team build queues a new build request which includes all the checkins occurred while the previous build was running. You can also limit the number of builds TFS can queue within a certain period of time.

image

Gated Check in:Gated check in similar to the CI build. It is gets triggered on code check-ins. The code however gets shelved and only is committed to source control if the build passes otherwise that check-in is rejected. Team build run one Gated Build at a time. When you have an active team that checks in many files it may take a long time for the code to be built and committed to source control. In TFS 2012, you can define the Gated Check in build definition to merge x number of submissions together. That feature improves the efficiency of TFS Team Build. If the consolidated build fails, Team build will build each submission individually and commit the changesets that succeed and reject the failed ones.

image

Scheduled: is a build that runs at a specific day of week and time. You may want to run a schedule this build off hours to run the tests that take long time on your code, e.g. integration, regression and/or coded UI tests. The scheduled build can run once a day. You can choose which days of week you want the scheduled build to run.

TFS Express: Scale out Build Service


This post is a continuation to TFS Express: Configure Build Service article. I will go through the steps to scale out the Build Service into another server (Build Server 2). Build Server 2 has Windows 8 Operating System and will be dedicated to build Windows 8 Store applications (future post).

image_thumb1

Steps

am doing the deployment on virtual machines. I already have TFS2012 Express installed, Build Server 1 configured with a build controller and a build agent and I will deploy agents on Build Server 2

In this version of TFS, Microsoft created on executable for TFS to install and configure TFS, Controllers and Build Agents.

On the Build Server 2, install TFS 2012 Express

Open the TFS Admin Console

Click Build Configuration

Click on the Configure Installed Features link

image_thumb9

Click Next or select Project Collection

Select a TFS Server and Team Project Collection and click Connect

image

Notice that the Configuration wizard detected that there are a controller and a build agent already installed

Click next to configure Build Services

image

Select Scale out build services. This options allows this server to work side by side with other machines where other controllers and/or agents installed

From the Number of build agents drop down, the recommendation is 1 agent per logical CPU

From the Add this capacity to the following resource, you can either select an existing controller or create a new one. In this post we are adding two agents to an existing controller based on the implemented topology.

At the bottom, you can see the Configuration summary.

Click Next

image

Select a system account or a specific user account if you want to limit the privileges for the build user

image

Click Next then Configure

image

Click Next and Finish if the configuration complete successfully

Go back to the TFS Express Admin console and notice that two agents have been installed. Make sure the that there is a green icon on the server’s icon which indicates that the agents are running in a healthy state.

image

In the next post, I show how to create a new build definition Visual Studio for Team Foundation Server. Stay tuned 🙂

TFS Express: Configure Build Service


Introduction

This article is a continuation to the TFS Express Series I started few weeks ago. Although, I will be using TFS Express in this article, the steps are the same if you are using the full version of TFS or you are scaling our the build service for the TFS Service (tfs.visualstudio.com)

In this post, I will be list the steps you need to implement the following topology:

image

This article assumes you already have Team Foundation Server Express installed and the application tier is configured. You can check this article to install and configure TFS Express

Permissions

You must be a member of the “Project Collection Administrators” group in Team Foundation Server to be able to deploy the TFS Build Server

Steps

I am doing the deployment on virtual machines. I already have TFS2012 Express installed and I will be deploying the Build Server artifacts on the other two servers.

In this version of TFS, Microsoft created on executable for TFS to install and configure TFS, Controllers and Build Agents.

On the Build Server 2, install TFS 2012 Express

Open the TFS Admin Console

Click Build Configuration

Click on the Configure Installed Features link

image

Select Configure Team Foundation Build Service

Click Start Wizard

image

Click Next to move to Project Collection Node

Click on the Browse button

Select a TFS Server or click the Servers button to add a new server

image

Click Next

image

Click next

My Build Virtual Machine had one logical CPU assigned to it. As best practice, you create one agent per logical CPU.

Click Next

image

Select a system account or use a user account. User account must be part of the Project Collection Build Service Account group

image

Click Next in the admin Console

image

Click Configure if the check was sucessful

image

From the admin console, you can disable, delete, restart or configure the build service, controller or agent(s)

image

Notice that the machine name will be added as a user to the group as well

image

 

To install and configure the build service on the second build server check this post