January 2009 - Posts
From Aaron Hallberg blog:
[…] change in TFS Build SP1 which reduced build log noise by cutting out the build steps for project-to-project references […] the fix in SP1 didn't actually fix the problem, at least not completely.
[…] As such, if a project was referenced by 10 other projects the fix in SP1 would reduce the number of spurious build steps from 10*3 to 9*3 rather than removing them altogether.
A hotfix is finally available that will address the remaining parts of the problem […]
VSTS MVP colleague Mathias Olausson reports:
“before SP1 the build time was about 2h 30 min, with SP1 build time in average 65 minutes and with the build hotfix we’re now down to less than 40 minutes. The build log has changed from 5500 lines down to 550.”
Download hotfix: TFSBuild TargetsNotLogged property fails to cut down noisy builds
Additional Info: KB article 958845
From Hakan Eskici's blog:
A security issue has been identified with Team System Web Access 2008 SP1 and we have recently published an update that fixes it.
Installation Notice
Please note that this is a full release, so you will need to uninstall any existing versions of Web Access before installing this update.
Update: Instructions to patching your installation without the need to uninstall/reinstall TSWA)
Update #2: KB article 961267 is now available.
Determining if the update is installed
Take a look at the About page (Help > About) in Web Access.
The version number will be 9.0.3275 for TSWA 2008 SP1 Update.
Download: Visual Studio Team System Web Access 2008 SP1 Power Tool
A: Microsoft posted a white paper on this.
From the whitepaper:
"Test results indicate that Web Access starts to hit the upper limits once the total number of work item objects in the memory is around 180. This translates to approximately 100 concurrent users with typical usage patterns."
"Test results indicate that Web Access can support up to approximately 500 users." (working with a minimum amount of data)
Download: Team System Web Access 2008 Scalability Limits White Paper
Planning
Installation, Configuration & Administration
Requirements Management
Version Control
There are some areas where data may remain behind after you use TFSDeleteProject.
- The TFS Warehouse is untouched. In order to remove the data from the warehouse, it must be rebuilt. (It is important to notice that, when the warehouse is rebuilt all the historic build data that has been trimmed from the system will be removed.) Rebuilding the warehouse is accomplished using the command SetupWarehouse. For more information, see SetupWarehouse.
- The build drop locations (i.e., the location where the build binaries, build log files, and test results log files are published during the build process) are untouched. Removing the build drops must be done manually.
- Any work item tracking metadata that is shared between projects will not be deleted.
- The version control shelve set may not be deleted if there is code in the shelve set from multiple projects.
Read the full story by Aaron Block.
If you develop small utilities for Team Foundation Server a lot you might want to save some time and use a project template (see bottom for file attachment) that already comes equipped with the correct references to the Team Foundation Object Model (Microsoft.TeamFoundation.*.dlls) as well as the most important using statements and a few lines of code to get started.
Installation
Copy the ZIP file to {MyDocuments}\Visual Studio 2008\Templates\ProjectTemplates.
Usage
Create a new project and select “TFS Utility” from the “My Templates” list.
The template creates a new Windows Forms application with references to the Microsoft.TeamFoundation.*.dlls (btw: the C# compiler gets rid of all references that were not used in the project during compilation)…
… as well as a a few using statements and some code to start from.
Happy TFS tool development!
In a small team this sounds like oversize, but in mid-sized large teams it's common that you do not know who is going to be the tester.
Looking at the Bug workflow from MSF Agile:
- while "Active" the project lead decided if and when the bug is going to be fixed and assigns it to the responsible developer.
- between "Active" and "Resolved" is where the developers implements the fix.
- between "Resolved" and "Closed" is where the tester verifies the fix.
When the developer finishes coding he changes the state from "Active" to "Resolved", e.g. by checking in and associating the changeset with the work item.
But by doing so the work item is still assigned to him. In our scenario he doesn't know who will be the responsible tester to verify the fix. So who knows?
The project lead might have that information. So either we assign it back to the project lead to make him assign it to as tester or we make the project lead specify the tester upfront (with the ability to change it afterwards if necessary).
In this example we'll implement the second approach.
Objective
Ask for the Tester when creating the bug and automatically u.se it for the transition from "Active" to "Resolved"
Required Work Item Customization
Step 1: Add a new string field to hold the tester
In this example we will make it a required field (<required/>) and ensure that it contains a valid user (<validuser/>).
<FieldDefinition> type="String" name="Tester" refname="TeamSystemPro.Samples.Tester">
<REQUIRED />
<VALIDUSER />
</FieldDefinition>
Step 2: Add a rule to the transition from "Active" to "Resolved"
Automatically copy the value of the tester field to the Assigned to field.
<FieldReference refname="System.AssignedTo">
<COPY from="field" field="TeamSystemPro.Samples.Tester" />
</FieldReference>
Result
When creating a new bug it's now required to select a Tester before it can be saving.
When choosing "Resolved" for the state "Assigned to" will be automatically filled with the contents from the "Tester" field.

The history correctly shows the change in the "Assigned To" field from the developer (here: "Neno Loje" to the tester (in this case: "Administrator")
Happy Customizing!
Team Foundation Server is easily customizable and equipped with a general purpose workflow or state machine. So you might ask yourself: why not put a non-development or rather related process in TFS instead of using separate software.
Showcase #1: Lead Management
Since here at AIT TeamSystemPro Team we are TFS consultants we decided to not use a commercial CRM tool for managing our leads but rather customize a team project in TFS for this matter.
Here are a few impressions of the experience:
Work Item queries:

Work Item layout:
in Outlook (via TeamCompanion)
The pretty simple workflow behind it:
Showcase #2: Customer Support
Needless to say that the TFS support that we offer is tracked using work items as well:
Showcase #3: List of managed TFS instances
Every TFS instance that we manage has a corresponding record:
Your Feedback
Do you have an interesting idea or have you used your TFS to support a non-dev related process? Feel free to leave me a comment or use the contact link – thanks!
If you click on a hyperlink in an TFS notification mail the following (read-only) web page comes up instead of a nice looking Team System Web Access dialog. Let's change that!
Objective
Make sure all links in the notification mails sent by TFS point to Team System Web Access (TSWA) rather than the integrated read-only web pages from TFS.
There are fourareas to look at:
- Work Item notification mails (has already been discussed here)
- Build notification mails
- Check-in notification mails
- Mails sent by Team Explorer (feature of TFS 2008 SP1)
Area 1 is part of a separate blog post, for Area 2 there are currently no equivalent steps (as stated in KB956761). Areas 3 and 4 can be accomplished through the following steps:
Step 1: Specify TSWA Uri using tfsadminutil
Set TSWA uri (as described on MSDN):
tfsadminutil configureconnections /TSWAUri:http://MyTFS:8090/
Verify URIs:
tfsadminutil configureconnections
From now on all your check-in notification mails as well as mails sent via Team Explorer link to TSWA.
Unfortunately there's one problem if we look at the check-in notification mail we'll read:
"Details about his check-in were not available when this alert was prepared.
Select the link above to view more details about the check-in."
Microsoft released a hot fix to correct this behavior.
Step 2: Install hot fix
The hot fix is publically available at: http://code.msdn.microsoft.com/KB957196

Result
Way better, don't you think?
An underscore ("_") is not a supported character for a server name according to the RFC standards and therefore Windows will warn you when trying to use it as part of a DNS name.
Symptoms
ASP.NET applications that use session state, like Team System Web Access, will work when invoked using the IP (http://1.1.1.1:8090/) but will fail after some crazy redirecting with a DNS error when using the server name (http://my_tfs:8090/).
Workaround
You can add a DNS alias and avoid using underscores in server names in the future.
(Thanks to Hakan Eskici from Microsoft for pointing this out.)
Update: Hakan now blogged about this: Strange TSWA connection issue if the server name contains an underscore character.
Update #2: Microsoft published KB article 968549 about this.
Objective
Allow rich HTML formatting in description fields of the MSF Agile process template.
Note: The MSF CMMI process does support HTML formatting by default. In order to use it you have to enable the formatting toolbar (see Step 6 below).
Work Item Customization
Step 1: Add a new HTML description field
Since the System.Description field is defined of type string as opposed to type HTML we need to create a new field:
Step 2: Change the work item layout
Use your own HTML field instead of System.Description
Step 3: Refresh Work Item cache
Right-click "Work Items" in Team Explorer and select "Refresh".
Step 4: Enable the formatting toolbar
Right-click on the Visual Studio toolbar, find and click "Formatting":
A new toolbar will appear:
Result
Click into the description field and use the toolbar to format your input:

Optional Step 5: Copying the old descriptions to the new HTML field
It would be a pity to loose the existing descriptions so let's write a small utility using the Team Foundation Object model to copy the "old" descriptions to the new HTML field:
static void CopyOldDescriptions()
{
// TODO: Change these values:
string tfsName = "servertogo";
string tfsProjectName = "WorkItemCustomization";
string tfsHtmlDescriptionFieldName = "DescriptionHtml";
string tfsWorkItemType = "Task";
using (TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer(tfsName))
{
WorkItemStore wit = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
WorkItemCollection result = wit.Query(String.Format("SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = '{0}' AND [System.WorkItemType] = '{1}'", tfsProjectName, tfsWorkItemType));
List<WorkItem> affectedWorkItems = new List<WorkItem>();
foreach (WorkItem wi in result)
{
if (wi.Description.Length > 0)
{
// Set new description
string value = (string)wi[tfsHtmlDescriptionFieldName];
if (String.IsNullOrEmpty(value))
{
wi[tfsHtmlDescriptionFieldName] = wi.Description.Replace("\n", "<br>");
}
else
{
wi[tfsHtmlDescriptionFieldName] += "<br><p>Old description:</p><p>" + wi.Description.Replace("\n", "<br>") + "</p>";
}
// Delete old description
wi.Description = String.Empty;
affectedWorkItems.Add(wi);
}
}
if (affectedWorkItems.Count > 0)
{
wit.BatchSave(affectedWorkItems.ToArray());
MessageBox.Show("Items updated: " + affectedWorkItems.Count);
}
else
{
MessageBox.Show("Nothing to do.");
}
}
}
Happy formatting. :-)
Objective
We did some changes to a file and now want to revert to an older version of that same file. In the concrete scenario we added a method called "Multiply" with changeset 8 and want to go back to the version of changeset 7.
Step-By-Step guide using the UI
Step 1: Get the version of the file you want to revert to into your workspace
Note: verify that the file really contains the version you expect and want to revert back to!
Step 2: Check out the file for editing
Note: You can freely specify a lock here to make sure none else checks in a new version of the file you are just trying to revert
Step 3: Check in the change you just made
Your check-in will generate a version conflict:

This conflict has to appear so that you don't accidently check in old stuff. You now have to confirm that you really want to override the version that is currently checked in with the older version in your workspace.
The conflict is now resolved:
The check-in was aborted due to the conflicts:
Step 4: Check-in again

Note: If you accidently reverted back to an old version you can use the same steps to open a newer version and upload this as the very latest version again.
Total: 20 clicks.
Alternative using the command-line tools (less clicks)
Instead of 20+ clicks you might think about automating these steps using TF.exe – and are down to 5 commands.
tf get MyClass.cs /version:C8
tf checkout MyClass.cs
tf checkin /noprompt /validate
tf resolve /auto:AcceptYours
tf checkin /comment:"Reverting to older version!" /noprompt
Here's ready to use batch file, which takes two parameters:
- %1: Name of the file you want to revert.
- %2: Version of the file, e.g. if changeset number when C7 stands for changeset 7


Although we use command line commands the check in dialog will pop up to allow us to specify check-in comments, notes and associate work items.
Problem description
When trying to create a new work item you receive the following error?

Cause
Thanks to this thread we now know that this message is caused by a DateTime Control in a WIT definition when its associated with a String field.
Fix
Only assign DateTime fields to DateTime controls.
Team System Web Access 2008 SP1 comes equipped with 10 languages for its UI that will be displayed depending on your Internet browsers regional settings.
You can set a language - independently what your browser settings by opening the Options dialog from the Settings menu.

and choosing your preferred language on the "Regional settings" tab.

By default a build label is deleted when the corresponding build gets deleted.
In TFS 2008 SP1 you can change that behavior by modifying the web.config file (on the TFS AT in folder %ProgramFiles%\Microsoft Visual Studio 2008 Team Foundation Server\Web Services) to:
<appSettings>
<add key="PreserveLabelsOnBuildDeletion" value="true" />
</appSettings>
(Thanks to Buck Hodges for this tip).
When trying to decide which of the two MSF Process Templates - Agile vs. CMMI Process Improvement - for TFS is the right starting point for your company, it helps to compare the work item types and its workflows.
You can download the full guidance from:
MSF for Agile Software Development
featuring 5 work item types: Bug, Requirement, Quality of Service Requirement (QoS), Risk and Task.
Work Item Type: Bug
Work Item Type: Scenario
Work Item Type: Quality of Service Requirement (also known as "technical requirement")

Work Item Type: Risk

Work Item Type: Task
MSF for CMMI Process Improvement
featuring 7 work item types: Bug, Requirement, Change Request, Issue, Review, Risk, Task
Work Item Type: Bug
Work Item Type: Requirement
Work Item Type: Change Request
Work Item Type: Issue
Work Item Type: Review
Work Item Type: Risk
Work Item Type: Task
As a personal note:
Both templates are a great starting point. The agile template might be a bit more lightweight whereas the CMMI template might fit more the vocabulary and processes that you are used to.
However, both are really just a starting point. In customizing the process you get way more out of TFS than with just using the built-in process templates.
For easier access to the various command line tools of TFS you can add the necessary directories to your %PATH% environment variable.
Paths to add (on a TFS client)
Drive:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
Paths to add (on a TFS)
Drive:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\TF Setup
Drive:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools
Background
- The 1rd path contains TF.exe
- The 2nd path contains BisSubscribe.exe
- The 3rd path contains tfsadminutil.exe
Note: TFPT.exe add its itself to %PATH%
How to

A: You can disable it from the options dialog, however this does not remove it entirely (as described here).
To turn it off completely you need to additonally set the following value in the registry:
HKCU\Software\Microsoft\VisualStudio\9.0\TeamFoundation\PowerTools
TeamTrackerHidden = True
(Thanks to Bill Essary from Microsoft for this tip)
You can download a ready to use .REG file that does both:
Caution: Make sure to carefully read the Installation Guide before installing this software.
What do I need it for?
- Access to TFS
Note: A plain Visual Studio still needs Team Explorer to be able to talk to TFS.
- It installs:
- a tiny Visual Studio with only the "Team Explorer" in it if you don't have Visual Studio installed already.
- a Visual Studio plug-in called "Team Explorer"
- a plug-in for Microsoft Excel 2003 or 2008
- a plug-in for Microsoft Project 2003 or 2008
- the Team Foundation Object Model
Where to find it?
- On your TFS 2005/2008 DVD in the "TFC" folder
- On your VSTS 2008 DVD (not on VS Pro)
- On the Internet:
What must be done prior to installing?
Problem description:
- You can't create new team projects.
- You see a red X on Report in Team Explorer, which you are sure is not related to permission issues (as described here).
- Using tfsadminutil.exe configureconnections /view you discover that the ReportServerUri looks similar to:
http://myTFS/ReportService.asmx
It should look something like:
http://myTFS/ReportServer/ReportService.asmx
Cause:
What happened? Looking at the MSDN docs I found this notice:
Workaround:
Specify the full path (including the trailing "/ReportService.asmx"), like this:
TfsAdminUtil ConfigureConnections /ReportServerUri:http://myTFS/ReportServer/ReportService.asmx
More information
There is an official KB article by Microsoft available .
You're done!
More Posts
Next page »