Upgrading TFS 2008 Work Items to 2010 version
Today I have been working with applying new features from TFS2010 to old TFS2008 work items. The approach I have chosen is to take the Microsoft CMMI version 5 as a base, and adding fields we added in the 2008 version of the process template. Then I tried to import the new definition using the witadmin command. The first issue was due to the fact that Microsoft changed some field names adding white space. You can solve this in two ways. Either you change the name of the fields in your definition file as described in this blog post http://www.chrismay.org/CategoryView,category,Programming,TFS.aspx or you use the Witadmin changefield command to change the name of the existing fields.
Another thing that caused some confusion was when trying to import Test Case. It worked fine, but when trying to create a workitem of this type I got an error that said “Work item type is not valid. You must specify a valid work item type.”
Really strange since when importing the workitemtype the workitem type was valid! So I started to search the web and found a hint about the new concept about Categories. So I first imported the categories and tried to create a test case again. But no – it did not work. I had to import the Test case Wit again before it worked. So I found some kind of “catch 22″ syndrome here, that since you cannot import categories before the workitem type exists, and the workitem does not work until the categories have been imported. So this is what you need to do (omitted some parameters – collection and project)
1 – witadmin witimport testcase.xml
2 – witadmin importcategories categories.xml
3 – witadmin witimport testcase.xml
Remember that you need to refresh the project if you have Team Explorer opened. If you encounter strange errors it can be the cache that is corrupted. Delete the cache folder in c:\documents and settings\<your username>\Local Settings\Application Data\TeamFoundation\3.0
Good luck!
Customizing the TFS Agile Workbooks
I have been working with customizing a process template for our company. This is a real challenge since there are so many aspects to this, and many are not known until later when the template is in use. It can then be hard to change it if you have been using it in a lot of TFS projects. I have been making different customizations since 2005 and I strongly advise you to put a lot of thinking effort into this work to make sure you do not end up with something that brings you more work…
In my work with a new corporate template for TFS2010 I have been using the Agile template as a base, but want to have more states since we think Active and Closed are just not enough. Also we want to make a template that could work both for Agile (Scrum) teams, for more traditional waterfall based approach and for maintenance projects. You could discuss a lot whether this is a good approach or not – but one additional thing that comes into place is how our TFS projects are structured. We have been creating TFS Projects for almost all of our software projects that mostly lead to a new system. This system always interacts with several other systems, both on the Windows platform and other platforms. In new projects several systems are involved which means you get a TFS project that “sends out” Change Requests to other TFS projects. This means that in the end it is really useful to be able to put together reports and queries that spans several projects. This also means that we use a terminology that is a bit Agile but does not use the “heaviest” Scrum terms. So for example we want to use “Effort” instead of “Story Points” to be more flexible.
We have also been influenced by the MS Scrum template and got rid of query structure of Iteration 1, Iteration 2, and Iteration 3 and replaced it with Current Iteration instead. A renaming and minor change in the queries was also made. One of the most useful new things I have come across so far in the 2010 release is the Agile Workbooks, with Iteration Backlog as the most valuable and Product Planning as the next. So we really want to have people use these since it brings more productivity into their work. So I ended up with a need to customize the Product Planning workbook in several ways.
* Replace “Story Points” with “Effort”
* Change the formulas to use more than two states, meaning that there is not such a distinct difference between Active and Closed
* Different names and folder structures in the Queries
I have also checked with Microsoft, and these customizations are supported.
The first two changes I have written about in a blog post called Howto Customize Product Planning Workbook
The third change is described in the blog post Necessary Customizations when changing Query Names in TFS Process Template
Howto Customize Product Planning Workbook
The reasons for me customizing the Product Planning Workbook can be found in the blog post called Customizing the Agile Workbooks
To get the customized workbook to be created and tied to each new TFS Project you need to customize the empty workbook in the process template. To do this you first have to download the template. This can be done in Team Explorer by right-clicking on the root node (collection) and choose Team Project Collection Settings, Process Template Manager. In the dialog shown, choose the template you want to customize and click Download. The template is written to a directory, and under this you can find the Product Planning Workbook in the folder
First of all I needed to replace “Story Points” with “Effort” in the query and the formulas. This showed up to be made in two places. First a change in the actual query file Product Planning.wiql where I simply replaced the field. Then to change this in the Product Planning Workbook. Not so suprisingly the workbook consists of some Macro code. It turns out that this code is based on values that can be found on a hidden tab in Excel. So this is how you easily change this:
1 – Open up the Product Planning.xlsx file. Find and press on the Macro button to the right end of the Ribbon called Show (at least that is a direct translate from the Swedish Visa).
2 – Choose to Edit the Macro. A Visual Basic for Applications window is shown. Make sure to mark the Microsoft Excel-object LocalizableStrings. At the bottom of the properties windows you can find the Visible property. Change this from “xlSheetVeryHidden” to “xlSheetVisible”

3 – Switch back to Excel. You can now see and edit an Excel sheet called LocalizableStrings. Here I have change two values. First I change “Story Points” in cell B5 to “LFEffort” which is the field name for the Effort field I have added in my workitems. Then I change Active to Closed in the cell C2. I will explain why later on.

4 – Get back to the Macro sheet and change back the visible property on the LocalizableStrings worksheet to “xlSheetVeryHidden”. Take caution here because when you change the property to hidden the tool will automatically change to another visible sheet. First I thought I did not change the property and ended up hiding all sheets…
5 – Secondly I needed to adjust how the sheet actually calculates the values in “Planned” and “Delivered” cells in the Iterations sheet. I found out that the formulas for this is created during project creation. And the state value is taken from the cell C2 in the LocalizableStrings sheet mentioned above. Since I have changed my state machine from Active+Closed to Proposed+Active+Resolved+Closed I need to find a way to have these values to be calculated in a correct way. The default behavior means that Planned is the workitems with State=Active and Delivered is State<>Active. The easiest way to customize this is to have Planned be State<>Closed and Delivered to be State=Closed. With the change in the LocalizableStrings sheet I have been able to change Active to Closed, but to switch the operators I have to do a change in the code that puts the formula together. This can be found in the module called ProductBacklog. In the code you can find a Sub called UpdateFormula. At the end of this Sub there are two calls to UpdatePointsColumn where the operator is the last parameter. So I simply switched these to get the desired behavior. Se image below.

6 – Switch back to Excel and bring up the first sheet and position the marker in the call A1. I did not do this at first so when the workbook was initialized during project creation the table for Product Backlog was created in the wrong sheet…
The only thing that now needs to be done is to upload the new process template using the reverse of what I explained at the beginning of this post. If you do process template customizations I really encourage you to use Source Control for all changes and not download and upload the workitem definition, but only use upload. In this way you get a controlled way doing this – and the possibility to roll back changes you do not want since you have the previous version in hand.
I have not yet needed to customize the Iteration Backlog workbook, but I might need to – and then I will write a blog post about that as well.
Necessary Customizations when changing Query Names in TFS Process Template
The reasons for me customizing the Product Planning Workbook can be found in the blog post called Customizing the Agile Workbooks
What I wanted to do was to change the query folders and query names in our process template. We wanted to have just a few necessary queries and make sure people used them instead of having a lot of queries where it is hard to find the ones that you need. So when I renamed the folder Iteration 1 to Current Iteration and got rid of the folders Iteration 2 and Iteration 3 I thought it was going to be fine. Our query structure now looks like this:

However I ended up with some problems with the Iteration Backlog workbook. When trying to upload the process template and create a new project I got an error. The “Iteration 1/Iteration backlog” query was not found. So this was because I renamed the Query folder to Current Iteration. So where can you change this? Since the workbooks reside in the Documents folder they are actually stored in Sharepoint. So my first place to look was in the Windows Sharepoint Services folder of the process template. The WssTasks.XML file seems to be the configuration file that controls the creation of the portal and then also the “binding” of the Agile workbooks to the newly created project. I have to admit I was a bit scared that the customization of this had to be done in code in some of the Tasks for creating the portal, but I did not have to worry. In the WssTasks.XML file I found the node <files> and under that a row that defines the file Iteration Backlog. And in that definition there is a pointer to the Query. So I just had to change to the correct folder name – and it all worked just fine!
<file
source=“Windows SharePoint Services\Shared Documents\Project Management\Iteration Backlog.xlsm“
documentLibrary=“Shared Documents“
target=“Current Iteration/Iteration Backlog.xlsm“
queryId=“Current Iteration/Iteration Backlog“ />
WebDeployproblem – error message not obvious
We have been using WebDeploy along with Beta 2 of TFS for some while. We have a local IIS installed on the WebServer and the build is taking the settings from this IIS when preparing the deploy package.
Last week we installed the RC of Visual Studio and TFS. Instead of upgrading the Build server we installed a new one. Besides from the problem with Build Defintions that I blogged about we had one peculiar problem. We got an error when building that said:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Web\Microsoft.Web.Publishing.targets (1650): The “MapUriToIisWebServer” task failed unexpectedly.
When making a search on “MapUriToIisWebServer” I found one (!) reference – how often does that happen! It referenced to the Connect site and a bug report. This told me a workaround would be to uncheck “Apply server settings to all users” on the Web tab of the Project Properties. I made this change and now it worked. Satisfied with solving that I went on with next thing without giving much thought to this…
However, things started to become strange to another user, that settings were not preserved and so on. So we started looking at this a bit more and realized what the checkbox actually did, when uncechking some settings were removed from the project file and ended up in a personal setting instead – not what we wanted.
So we started digging into this. A local build in VS worked. So to track down the error I went to the build server trying to do the same build. And this is when things started to show up. Loading the web project that contained the webdeployment did not work. An error message similar to this appeared:

The components it complained about was the IIS 6 Management Compability and some more stuff related to IIS 6. So I ended up looking at Vishal Joshis blog post about Basic Microsoft Web Deployment Tool Setup For Visual Studio 2010 and ended up installing some role services. First I tried to add the things he highlights but ended up added everything with Security and everything with IIS 6 as well as the Management Service.
Now I was certain it would work, but I ended up with another error that is pretty new and unfamiliar to a Windows XP user:

I checked, and the account I was running under was an administrator. Then I realized I was not running the process as administrator. So right-click and say “Run as administrator” made the trick. Now it works.
A long way to a pretty simple error, but the first indication of the error was not that obvious…
Solving build problems after upgrading from Beta2 to RC
If you like me did not read the upgrade manual thoroughly before trying to run your existing Beta2-builds in TFS 2010 RC you might have encountered some or all of these problems. (Upgrade manual can be found in this post http://blogs.msdn.com/bkrieger/archive/2010/02/03/tfs-2010-beta2-to-rc-upgrade-guide.aspx)
Build ends with the following error: File not found: C:\Windows\Microsoft.NET\Framework\v4.0.21006\MSBuild.exe
If you look in the Framework folder you notice that the RC of .NET Framework is in a folder called v4.0.30128 – so of course the files cannot be found.
In the upgrade guide, chapter 5 – point 3 you can read that you have to update your Build templates. It also says to create a new project and take the templates from there. One point that is not that clear in the guide is that if you create a new project in a Collection that was created under Beta2 you will get the Beta2 templates. So you will have to create a new Collection and then create a new project in that collection to be able to get a hold on the new Build templates. So the steps in chapter 5, point 2 is what you should do for the build templates as well.
I also made the obvious mistake not the check-in the new templates after adding them, so I did not find the new templates at first. Luckily I have made this error several times, so I knew how to solve it
Since we installed a complete new Build Server with the RC version we ran into the following problem as well.
When using Lab Management you have several Agents. So when configuring your builds you might point to the Build Server as described in this post http://tomasscott.wordpress.com/2010/01/09/default-setting-might-cause-problems-with-tfs2010-builds/
Remember to change that value for the build server as well as the value on the tab Build Defaults.
Enjoy the RC!
User experience with Gated Check-in
When your TFS administrator has enabled the Gated Check-in feature you do not notice anything at first. However, when you check in files a new dialog box appears:

As you can see in the green-marked area the system has created a Shelveset where your changes are stored temporary. The changes are then being built using the build server. If the build is successful the changes are committed, otherwise they are not – which means your changes have not been checked-in.
The red-marked area shows a check-box that makes it possible to choose if your changes should be kept locally or not. Default is that they are preserved (as in the picture). More about this later.
In the Build Explorer a build that is triggered via a Gated Check-in is indicated by an icon showing up next to the build, see this image:
![]()
Above the green indicator (that I put there) you can see the icon. In the same place you see the clock icon if it is a scheduled build and so on.
When the build has been finished it either when all green and the check-in has committed, or an unsuccessful build was the result, and then the check-in was Rejected. As a user you notice this as a pop-up dialog is diaplayed. Below you can see the two different dialogs:


In the case where the Check-in has committed you probably want to make sure your workspace looks the same as what has been checked-in. You do this by pressing the Reconcile button. If you checked the “Preserve my pending changes locally” you the tool will sync everything for you. You can find the same functionality in the Build Explorer if you bring up the build log. There you can see if the check-in was Committed or Rejected and you can perform the Reconcilation from there as well.
Some important point to think about:
- Your changes are not Check-in if the build was not successful. A partially successful build is considered unsuccessful.
- If the build works locally, but not at check-in, one thing to look for is project reference problems
This feature will most certainly change the work behavior of the users. Make sure not to get any strange mis-behavior…
Good luck!
Configuring Gated Check-In
You have probably heard of a new feature in Visual Studio/TFS 2010 called Gated Check-In. The problem this is supposed to solve is the problem of broken builds – when a check-in makes the next build fail. In order to start using this feature you configure it in a certain way.
First you create a Build definition pointing out the solution you want to build in your “Gate”. You configure it to trigger at Gated Check-in as below.

Next important step is to chose when this build should trigger. This is configured under the Workspace tab in the Build definition. By pointing out a workspace location, whenever trying to check-in a file to that workspace a new build is triggered. In our current application we have three different solutions and each has its own build associated to it.

The functionality you get will make it impossible to check-in anything whenever this build is unsuccessful. Remember that a partially successful build, for example when some unit tests fail, will be considered an unsuccessful build.
I have also posted about the user experience Gated Check-in, se this post http://tomasscott.wordpress.com/2010/02/07/user-experience-with-gated-check-in/
Default setting might cause problems with TFS2010 Builds
Do you experience problems with your builds in TFS2010?
Unchanged builds that sometimes work and sometimes fail?
You might have problems with build agents. Build agents are used on build servers, and also on target machines to make it all work.
When you start up a new build, default is a build agent called *. So sometimes the build servers agent is used, and sometimes any other agent found on the network.
Of course this behavior is good if you have several identical build servers and want to take the first free one. However, if the other build agent is not a complete build server with Visual Studio installed, the build fails.
Here you can see a certain section of the Build definition with the default value of the build agent, which is the wildcard.
So be sure to point out a build agent that can be used to build your solution. This also makes the naming of you build agents important, so you can use the wild card in a good way. For example, call all build servers something with VSBuild, and you can use *VSBuild* as your build agent – and any free agent matching this name will be used.
In this image you can see that I have specified which build server to use.
Videointervju om Visual Studio 2010
Om ni följt bloggen så vet ni att vi kör ett projekt med Visual Studio och TFS 2010. Nu finns en videointervju med oss publicerad på Channel9, http://channel9.msdn.com/posts/buzzfrog/Lnsfrskringar-en-av-de-frsta-att-kra-Visual-Studio-2010-p-riktigt
På TechDays i Örebro 23-24 mars kommer ni ha möjlighet att höra mer om våra erfarenheter. Har just fått veta att vi blivit antagna som talare! Ytterligare en anledning att åka dit!?
-
Recent
- Upgrading TFS 2008 Work Items to 2010 version
- Customizing the TFS Agile Workbooks
- Howto Customize Product Planning Workbook
- Necessary Customizations when changing Query Names in TFS Process Template
- WebDeployproblem – error message not obvious
- Solving build problems after upgrading from Beta2 to RC
- User experience with Gated Check-in
- Configuring Gated Check-In
- Default setting might cause problems with TFS2010 Builds
- Videointervju om Visual Studio 2010
- Grattis SourceSafe-användare
- Hierarkiska workitems
-
Links
-
Archives
- October 2010 (4)
- February 2010 (4)
- January 2010 (1)
- December 2009 (1)
- November 2009 (1)
- September 2009 (3)
- August 2009 (1)
- June 2009 (1)
- May 2009 (4)
-
Categories
-
RSS
Entries RSS
Comments RSS



