For the customization of the work item controls for the client are many examples. There is even a codeplex project that hosts some examples. However if you want to provide a custom work item control for Web Access, it turns out that there is only little information. In this post I will describe what I did to create the custom Web Access control.

Thanks to Guneet Umra of Avanade and Serkan Inci of Microsoft to help me out on this.

For this example I will show you how you can create a textbox that has a blue background, but you can make it as fancy as you like.

///<summary>/// THe underlying data is changed. Change the contents of the TextBox accordingly///</summary>publicoverridevoid InvalidateDatasource()
{
base.InvalidateDatasource();

// If the field is validif (HasValidField)
{
// And it has a valueif (Field.Value != null)
{
// change the contents of the TextBox Value = Field.Value.ToString();
}
else {
// else clear the value Clear();
}
}
else {
// If the field is not valid, then also clear the contents of the TextBox Clear();
}

To distribute this control, the easiest way is to create a setup project. Since the location is different for x86 and x64 the easiest way is to create two setup projects.

First create the x64 setup project: Add a new project of type Setup Project with the name WebControlSetup.x64 (you can find the project type in the Add New Project dialog under Other Project Types –> Setup and Deployment –> Visual Studio Installer)

Remove the User’s Desktop and the User’s Programs Menu folders

Click on the project in the Solution Explorer and open the properties window. Change the TargetPlatform to x64

Change the DefaultLocation of the Application Folder to [ProgramFiles64Folder]\Microsoft Team Foundation Server 2010\Application Tier\Web Access\Web\App_Data\CustomControls

Right click on the right pane to add the Primary output of the WebControl project

When you add the primary output also all the Microsoft.TeamFoundation dll’s are added. Those dll’s should not be installed however

You can remove those by opening up the Detected Dependencies, select those dll’s, right click to open the context menu and choose Exclude. You will see the dll’s will be removed from the File System window

Now also add the Content of the WebControl project

Repeat these steps to create a x86 setup project, but now use the target folder “[ProgramFilesFolder]\Microsoft Team Foundation Server 2010\Application Tier\Web Access\Web\App_Data\CustomControls”

You can now build the WebControl solution, and install the appropriate msi on the TFS server.

There is a nice little feature in TFS to have two separate layouts for the Windows and the Web UI: You can add the attribute Target=”Windows” or Target=”Web” to the Layouts node to show two different layouts.

When teams are adopting Team System Web Access, they get stuck in a known issue in Team System Web Access. It allocates a lot of memory that is not freed up. So over time you can see error messages that cannot be explained.

To improve the performance of your TSWA installation you can do the following things:

Make sure you have installed SP1; we have fixed a very significant memory leak there.

Create a designated app pool for TSWA application. Work item tracking consumes a lot of memory, so it is better not to share it with other applications.

Make sure you’re sharing metadata cache by specifying WorkItemTrackingCacheRoot parameter in the config file. Not doing that will result in creating a separate full copy of the metadata cache for each connected user.

Grant read/write permissions to the TSWA account to the HKLM\Software\Microsoft\VisualStudio\9.0 key and everywhere under it. Not having read/write access to these keys results in full metadata cache download every time new user connects to a server. That data gets thrown away because it is already in the cache in most cases.

Configure garbage collection for the http cache. I don’t know, however, whether http cache is used in 2008 version of TSWA, but at least it won’t hurt anyway. Here’s what we’re using at Microsoft: