Time travelling with Work Item Queries In TFS 2008

by Ewald Hofman 20. April 2010 04:51

Someone asked me if I could help him because he made a mess of the work items. He published old data from Excel to TFS, so all the updates of his team mates where gone with one click.

There is a nice and very under-appreciated feature in the work item queries to get the values of the work items at a moment in history as if you created a snapshot at that time. It is pretty easy to accomplish this with the ASOF feature. The following steps show you how you can use the ASOF statement.

  1. Create a new query with the fields and filters you are interested in via the default “Add query” command
  2. Save the query (File –> Save New Query 1 [Query])
  3. You get now the ability to store the query on the file system

    TimeTravelling001
  4. Select an appropriate location and click Save
  5. Open the file you just saved in Notepad. You will now see the Work Item Query Language (WIQL) that is used to define the query. For more information on the syntax, please refer to http://msdn.microsoft.com/en-us/library/bb130198.aspx
    This WIQL could look like:

    <?xml version="1.0" encoding="utf-8"?><WorkItemQuery Version="1"><TeamFoundationServer>http://myserver:8080/</TeamFoundationServer><TeamProject>TestTeam</TeamProject><Wiql>SELECT [System.Id], [System.Title] FROM WorkItems WHERE [System.AssignedTo] = 'Ewald Hofman' ORDER BY [System.Id]</Wiql></WorkItemQuery>
  6. You can only execute a modified WIQL with a .NET app. So lets create a new C# ConsoleApplication project
  7. Add the references to
    1. Microsoft.TeamFoundation.Client
    2. Microsoft.TeamFoundation.Common
    3. Microsoft.TeamFoundation.WorkItemTracking.Client
    4. System.Windows.Forms

      you can find the TeamFoundation assemblies in %Program Files%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies
  8. Add the following using statements to your code

    using Microsoft.TeamFoundation.Client;
    using Microsoft.TeamFoundation.WorkItemTracking.Client;
    using System.Net;
    using System.Windows.Forms;
  9. Now add the following code to the class Program. You will have to modify the tfsServer and queryText variables to your own values. Notice at the end of the queryText the ASOF syntax. With this statement you are time travelling.
    [STAThread()]
    static void Main(string[] args)
    {
    
    
        StringBuilder clipboardText = new StringBuilder();
        bool titlesPrinted = false;
    
    
        string tfsServer = @"http://myserver:8080";
        string queryText = @"SELECT [System.Id], [System.Title], [System.State] FROM WorkItems 
    WHERE [System.AssignedTo] = 'Ewald Hofman' ORDER BY [System.Id] ASOF '4/10/2010'"
    ; // Open the connection to TFS using (var tfs = new TeamFoundationServer(tfsServer, CredentialCache.DefaultCredentials)) { // Get the work item service var store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore)); // Execute the query var wiCollection = store.Query(queryText); // Iterate through all work items foreach (WorkItem wi in wiCollection) { // Add the column headers if (!titlesPrinted) { titlesPrinted = true; foreach (FieldDefinition field in wiCollection.DisplayFields) { clipboardText.Append(field.Name); clipboardText.Append("\t"); } clipboardText.AppendLine(); } // Add the work item values foreach (FieldDefinition field in wiCollection.DisplayFields) { clipboardText.Append(wi.Fields[field.Name].Value); clipboardText.Append("\t"); } clipboardText.AppendLine(); } } // Put the complete text to the clipboard, so it can be copied to Excel if (clipboardText.Length > 0) Clipboard.SetText(clipboardText.ToString(), TextDataFormat.Text); }
  10. You can now run the code, open Excel and start paste command.

Tags:

TFS SDK | VSTS 2008 | Work items

OLAP PivotTable Extensions – your MDX reporting help

by Ewald Hofman 7. December 2009 01:48

In TFS you can create your own reports based on the Analysis warehouse. In order to be able to query the cube, you need to use the MDX language. This language is not very intuitive for someone who is used to query transactional databases, since you now have to deal with cubes, slices, facts and measures.

When you use Excel, you case easily query the Analysis warehouse. Excel will create the MDX query for you. There is a nice tool on CodePlex that gives you the ability to see the MDX query that Excel uses. You can find the tool at http://www.codeplex.com/OlapPivotTableExtend

You have now the power of the usability of Excel and the layout formatting of Reporting Services.

Go make a great impression on your boss!

Tags:

Reporting | VSTS 2008

TFS Sidekicks minor release update (2.4)

by Ewald Hofman 15. November 2009 08:39

When you are an administrator of a TFS environment, TFS Sidekicks helps you out a lot. Of course you can get all information with the command line tools, but I want to use the useful storage in my head for other things than remembering command line arguments.

Features that are included in TFS Sidekicks are, I most use are:

  • Workspace sidekick
  • Status sidekick

With the Workspace sidekick you can list all workspaces that are in the system, and filter them. This is extremely useful when a computer is recycled to another user, and the previous user of the computer did not delete all his workspaces. Since one computer can only have one mapping to a directory, the second user cannot create a workspace mapping to the directory, which is recommended to use at the company. You can now easily search for all workspace that are in use by the user that left the company and remove those workspaces.

As an administrator, I often get the request that user, who has left the building or who is enjoying the sun very much, has a file checked out and that checkout have to be made undone. With the Status sidekick you can easily search for the file. On the file you found, you have the option to undo the changes.

The new version of Sidekicks is the last one that is targeted for TFS 2005 and TFS 2008. The next version (expected end 2009), which targets the TFS 2010 (beta 2) version, can be expected at the end of the year 2009. The minor release contains the following:

Features

  • Labels Sidekick: Support filtering by file extension in Labels Comparison window
  • Code Review Sidekick: Check-in policy violation indication shown next to changesets in a list
  • Workspace Sidekick: Support ability to save list of found workspaces
  • New Users View Sidekick: Show searchable list of user names and user display names in TFS Valid Users group

Bug fixes

  • BUGFIX VS Integration (Dynamic History): exception thrown when viewing history on pending adds
  • BUGFIX Code Review Sidekick: Changeset/Work Item selection dialogs do not keep last set of parameters set
  • BUGFIX Code Review Sidekick: When all changesets selected, the list of changesets is not scrollable
  • BUGFIX Labels Sidekick: Multiple selection of labels in list does not work with keyboard
  • BUGFIX Labels Sidekick: Labels Comparison is out of sync for certain label content
  • BUGFIX Status Sidekick: Undoing changes on root node ($\) causes an exception

Tags:

VSTS 2008

TFS 2008 API - Create a link between work items

by Ewald Hofman 3. November 2009 11:33

With the new version of TFS on the horizon, which supports hierarchical links out of the box with a cool user interface to quickly create a nice work breakdown, many of us are still stuck to TFS 2008 (which of course has many great features :) ). This post shows you how you can create the links by making use of the TFS API to quickly simulate a breakdown. Especially when you combine this post with one of my previous posts Report on Work breakdown in TFS.

To make this example working, add the following using statements to your file

using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;

First start with the following code snippet to get the Team Project that contains the work items you want to link

var server = new TeamFoundationServer("myServer");
var store = (WorkItemStore)server.GetService(typeof(WorkItemStore));
var project = store.Projects["myTeamProject"];

then you have to find the ‘parent work item’ you want to add the work item links to (in the example the work item 1234)

var parentWI = store.GetWorkItem(1234);

This post will add all work items that are returned by a team query, so first we have to find the team query

private static StoredQuery GetTeamQuery(Project project, string queryName)
{
        foreach (StoredQuery query in project.StoredQueries)
        {
                if (string.Compare(query.Name, queryName, true) == 0) return query;
        }

        return null;
}

Then of course we need to retrieve the query and make it executable by replacing all parameters in the query.

var query = GetTeamQuery(project, QueryTextbox.Text);
var querystring = query.QueryText.Replace("@project", "'" + project.Name + "'");
var wic = project.Store.Query(querystring);

Then iterate through the results of the query, and add all the work items to links of the ‘parent’ work item

foreach (WorkItem wi in wic)
{
     parentWI.Links.Add(new RelatedLink(wi.Id));
}

Finally you have to save the 'parent' work item

parentWI.Save();

You can of course use this example as base for your solution to create some sort of auto-linkin of work items.

Good luck.

Tags:

VSTS 2008 | Work items

Calculate Code Metrics automatically for all your applications and see the trend

by Ewald Hofman 7. October 2009 04:32

In Visual Studio 2008, Microsoft has added the code metrics, which gives you information about the quality and maintainability of the application. Unfortunately you can not easily start the code metrics automically, and you can not integrate it from Team Build.

There is NDepend, which has the ability to integrate with team build, that gives you access to the same code metrics. But NDepend does not have a repository so you can build a trend of the metrics for all your applications stored in your TFS source control.

So I created a solution which works around these problems.

The idea of the application is quite simple:

  1. Download all sources in TFS to the local drive
  2. One by one open the solution
  3. For each solution calculate the code metrics
  4. Store the results of the code metrics in a database for reporting and trend analysis

It is do-able, but it was a long story to get a solution that works. I like to share the solution with you.

Prerequisites:

  • EntLib 4.0
  • SQL Server 2005
  • Visual Studio 2008 Development Edition or Team Suite
  • Team Foundation Server 2008
  • Microsoft Excel 2003 (not tested on Excel 2007)

To start the application, do the following:

  1. Download the sources at the bottom of the page.

  2. Open the solution

  3. Deploy the CodeMetricsDatabase project to the SQL Server of your choice

  4. Set the connection string to the SQL Server the database project is deployed to

    1. Open the app.config

    2. Change the CodeMetrics connection string in the connectionStrings section

  5. Start the application with the following parameters:

    1. TFS server name (for example http://tfsserver:8080)

    2. Start node in TFS source control (for example $/MyTeamProject/MySolution)

    3. The local path where the sources are stored (for example c:\CodeMetricsCache)

    4. And optional you can pass the Team Project you are only interested in

GatherCodeMetrics.zip (289.11 kb)

Reporting

To be able to see the trend of the metrics, I have created a report which you can install on the TFS Reporting site. To install the report, you must add a datasource called "CodeMetrics". This datasource must have the connection information to the database where you store the code metrics.

The second step is to update the rdl below. You can now see the trend of the code metrics of all your applications.

Code Metrics Trend.rdl (34.71 kb)

Tags:

Reporting | VSTS 2008

[Update] Time sheet

by Ewald Hofman 4. October 2009 01:08

A lot of software shops want to use TFS as the time tracking tool. Out of the box, TFS does not provide this information, because all time is entered cumulative per work item. But you can find the information when you look at the transaction database table where all the changes to the work items are stored.

This is exactly what I did. I created a report to read from the transaction table to present the information per user per day. This leads to report as below.

 

The post shows you how you can find this information yourself. At the bottom of the post you can find the rdl.

The base of the report is based on the transaction table of the work items. This table is called "Work Item History". The tricky part of the query is to find for each transaction record (which is a change to - or revision of - the work item) its previous revision. When you have that information, you can calculate the difference between the two records. This difference is the amount of time the developer has added to the completed work, and thus the hours registered.

The Sql statement that gives you this information is the following.

SELECT
    ...
FROM
            dbo.[Work Item History]
    INNER JOIN    dbo.[Work Item]
                    ON    dbo.[Work Item History].[Work Item]        = dbo.[Work Item].__ID
    LEFT JOIN    (            dbo.[Work Item History] [Previous Work Item History] 
                INNER JOIN    dbo.[Work Item] [Previous Work Item]
                                ON    [Previous Work Item History].[Work Item]    = [Previous Work Item].__ID 
            )
                ON    [Previous Work Item].System_Id            = [Work Item].System_Id
                AND    [Previous Work Item].System_Rev            = [Work Item].System_Rev - 1
                AND    [Previous Work Item History].[Record Count]    = -1
 

For each transaction there is a negative record to set the values to 0 and a positive record to set the values to the actual values. For the previous revision we are only interested in the positive record, which is decorated with the "Record Count = -1.

When you have this starting point, you can add more tables to support filtering the data, such as on Team Project, Area path, Iteration path, Assignee, etc. I did add those four filters to the report. This resulted in the report that is attached to the blog post.

This report is view only. Notion solution has created a nice product that adds the ability to enter your time sheet from within Visual Studio. For more information on that solution, see http://www.notionsolutions.com/Products/Pages/NotionTimesheet.aspx

TimeSheet.rdl (29.97 kb)

Tags:

Reporting | VSTS 2008 | Work items

Use Powershell to execute a TFS console app for each team project

by Ewald Hofman 7. September 2009 23:18

I wanted to remove one of the field mappings for MS Project for all team projects. Of course I could create a simple batch file and then retrieve all team project names from somewhere and copy the command several times. But as a real IT guy: I am lazy.

So I wanted to automate the process. Of course I could have used the TFS API, but then you have to start visual studio, put in the same code over and over again. I wanted to explore new fields, being Powershell.

There is a lot of information about powershell on the web. An excellent blog is from James Manning. But you can also see the Powershell help on Technet.

This post covers the execution of the TFSFieldMapping.exe on all team projects to upload new field mappings.

Step  Descriptio 
To be able to iteraterate through the team projects, we need to make a connection to TFS. There is an excellent script, created by James Manning, called get-tfs, which you can find at: http://blogs.msdn.com/jmanning/archive/2006/09/28/776141.aspx  
2 Download the script and place it in the same directory as your script will be saved.
3 Create a new file called UploadMappings.ps1
4 Open the file in notepad
5 Enter the contents (see below) in the file
6 Save the file
7 Open the command prompt
8 Type Powershell
9 Go with cmd "my dir" to the directory where your script is located
10 Type .\UploadMappings

The full script looks like

 

param(

)
begin
{
 $cmd = """c:\program files\Microsoft Visual Studio 9.0\Common7\IDE\tfsfieldmapping.exe""";
 $server = "[TFS URL (eg. http://mytfsserver:8080)]";
 $tfs = .\get-tfs $server;
 $css = $tfs.css;
 $mappingfile = "[location of mapping file]";
}

process
{
 $css.ListAllProjects() | % {
  "Upload fields for $_";
  $info = new-object System.Diagnostics.ProcessStartInfo;
  $info.FileName = $cmd;
  $info.Arguments = "upload $server ""$_"" $mappingfile";
  $info.UseShellExecute = $false;
  $p = [diagnostics.process]::start($info);
  $p.WaitForExit();
 }
}

Tags:

VSTS 2008

Side by side installation of TypeMock on the build server

by Ewald Hofman 2. September 2009 05:41

When you are in a situation where you develop applications that are tightly integrated with other systems, you want to have multiple tests such as the unit test, the system test, the integration test and the user acceptance test. You want the unit test to only bring a class under test, without having to bother about other systems and/or applications. To enable this functionality you can make use of a mocking framework such as TypeMock.

Since unit tests are executed frequently on the build server, you need to somehow add this functionality to the build server. You can do this with two methods:

  1. Install TypeMock on the Buildserver.

  2. Add the following lines to your build script:

    <BeforeTest>
       <TypeMockStart />
    </BeforeTest>
     
    <AfterTest>
       <TypeMockStop />
    </AfterTest>

     

You now can use TypeMock. But what to do when you want to support multiple versions of TypeMock for different projects. Since when you update to a newer version to TypeMock you don't want to force all projects to update to the new version. To support this, you need to create a side by side installation. The following steps tell you how to achieve that.

  1. Do not install typemock, but create a directory per version you want to support

  2. Copy per version the files (see http://www.typemock.com/Docs/UserGuide/newGuide/Documentation/InstallingAutoDeploy.html for the list of files you have to copy) from the Isolator directory and from the x86 (or the x64, when running 64 bit) folder to the version directory (created in the previous step)

  3. Add the following lines to your build script. Type will copy the dll's in the [version directory] to the GAC.

    <Import Project="[version directory]\TypeMock.MSBUild.Tasks" />
     
    <Target Name="RegisterTypeMock">
        <TypeMockRegister Company="TypeMock" License="TypemockLicense" AutoDeploy="True" />
    </Target>

     

  4. You can now kick off your builds, and support multiple versions of TypeMock

NOTE:

There is a big caveat with this approach. TypeMock heavily uses the profiler to be able to mock the code. Only one version of TypeMock can have an instance of the profiler running, so when you are running builds in parallel which use different versions of TypeMock, your builds will fail. You can overcome this issue to not use the side-by-side installation, but make use of multiple build servers, with different TypeMock versions installed.

In TFS 2010, there will be a nice feature to support that scenario. You can add metadata to your build agent to indicate which version of TypeMock is installed. In the build definition you can add metadata to indicate which version of TypeMock is required. When you kick off your build, the build controller will automatically look for a server that satisfies your demands and the build is executed on the correct build server

 

Tags: , ,

Team Build | VSTS 2008

Renamed or deleted AD user prevents work item to save

by Ewald Hofman 31. August 2009 00:43

When a user is removed from AD, all work items the user has created and/or changed can't be saved anymore. To overcome this issue, you can do the following

Step Description
1 Download the TFS 2008 power tools from http://www.microsoft.com/downloads/details.aspx?FamilyID=00803636-1d16-4df1-8a3d-ef1ad4f4bbab&displaylang=en 
2

Create a new xml file with the following contents:

<?xml version="1.0" encoding="utf-8" ?>
<TfsWitDisplayNameChanges>
  <!-- List of field reference names to update. -->
  <Fields>
    <!-- Core "Person" Fields -->
    <Field refName="System.AssignedTo" />
    <Field refName="System.ChangedBy" />
    <Field refName="System.CreatedBy" />
    
    <!-- Non-Core "Person" Fields -->
    <Field refName="Microsoft.VSTS.Common.ActivatedBy" />
    <Field refName="Microsoft.VSTS.Common.ClosedBy" />
    <Field refName="Microsoft.VSTS.Common.ResolvedBy" />
 
    <!-- Add any custom "Person" fields here. -->
  </Fields>
  
  <!-- List of old and new values. -->
  <Values>
    <!-- Display name format changes. -->
<Value oldValue="Doe, Jane" newValue="Jane Doe" deleted="false"/>
 
    <!-- Display names for a deleted user -->
    <Value oldValue="John Q." newValue="John Q. Public" deleted="true" />
 
    <!-- Someone gets married and their name changes. -->
    <Value oldValue="Amy Smith" newValue="Amy Jones" deleted="false"/>
 
    <!-- Add additional Value elements here. -->
  </Values>
</TfsWitDisplayNameChanges>

 

3 Change the mapping file, so it reflects your own users
4 Save the mapping file
5 Open a new command prompt, you must start the command prompt with a user account that has access to the TFS databases
6 In the command prompt change the directory to %Program files%\Microsoft Team Foundation Server 2008 Power Tools
7

type the following command:

tfsusers.exe update /server:<tfsserver> /mappingfile:<location of mapping file>

Now the database has changed all entries in the work item of the old username to the new user name. It is not ideal, but you can at least save your work items again.

You might consider to not delete user accounts from AD, but to disable them to not be forced to do this action every time.

Tags:

VSTS 2008 | Work items

GDR R2 database projects

by Ewald Hofman 21. August 2009 06:51

A collegue asked me to help him out with his database deployment on the build server. In the past I did that before, with a lot of strugle and thought that using the same script could be simple applied to make it happen. Of course it didn't work out in that way. In my quest to solve the problem, I found some advise to update the GDR R2 release of Visual Studio for Database Professionals (http://www.microsoft.com/downloads/details.aspx?FamilyID=bb3ad767-5f69-4db9-b1c9-8f55759846ed&displaylang=en). There were some minor issues when updating the database project that I want to share with you.

  1. Install the DB Pro GDR R2 on your local machine and on the build server

  2. Open your solution. A wizard pops up and asks you to upgrade your solution. Walk through the wizard

  3. When the wizard finished, open the project properties of the database project

  4. Change the Deploy action in the Deploy tab to "Create a deployment script (.sql)"

  5. Build your solution

  6. Reset the Deploy action to "Create a deployment script (.sql) and deploy to the database"

  7. Open the Configuration Manager. You can find that in the build Menu Item.

  8. Open the configuration dropdown for the database (which has the value Default) and choose the option <New>

  9. Create a new configuration Debug and a new configuration Release. Be aware that you copy the settings from Default and that you uncheck the checkbox "Create New Solution Configurations"

  10. Close the dialog, so you return to the Configuration Manager

  11. Form the Configuration dropdown, now select <Edit>, and delete the Default configuration

  12. Choose in the dropdown in the topleft corner of the Configuration Manager for the "Active solution configuration" the value Debug

  13. Ensure that the value for the Configuration dropdown is set the Debug, and the Build and Deploy checkboxes are checked.

  14. Change the "Active solution configuration" to Release

  15. Ensure that the value for the Configuration dropdown is set the Release, and the Build and Deploy checkboxes are checked.

  16. Save the modifications

  17. Go the project properties of your database project.

  18. Change the Configuration to Release, to set the properties for the release configuration

  19. Change the Target connection string to the database that should be used by the build server.

  20. Save your changes

 

When you have a team build configured, your database project will be deployed in the Release configuration. You don't have to add anything else to make the deployment of the database project happening through the build server. 

 

Tags: ,

VSTS 2008

Useful usage of MS Project

by Ewald Hofman 17. August 2009 06:27

Problem

When I heard from TFS the first time in 2005 I was very delighted to see the MS Project integration with TFS. When starting my first project in TFS, I immediately started to use MS Project to plan the project. Finally I was able to see what the impact would be for the project and also use it to communicate very well with the developers, testers, etc.

After the first week I realized that MS Project is very nice to show an initial (high level) project plan, but to use it for progress tracking it is not the best tool. Let's tell why.

Take a very simple project plan

 

I upload the data to TFS, and I am going to work on the second task. The following day I level the resources to see what the changes are to the original project plan. The result of this is:

 

According to this plan, I have done nothing on monday and that I will have no tasks for today. This leads to a delay in my project plan of a day, although in reality there is no delay at all. I would have expected the following plan:

 

This behaviour is by design in MS Project: any completion of a task will not be moved when leveling the resources. And this behaviour did make me decide that to not use MS Project anymore.

Solution

Lately a new user wanted to use MS Project and asked me whether it was possible to work with MS Project. I discussed with him why he shouldn't use MS Project, but then he came with a brilliant idea. He wanted to see the remaining work only. This made me think.

Imagine that the Completed Work will not be synchronized with TFS, then a task would be always 0% completed, so the remaining work of the task will be moveable, and the completed part of the task will disappear from the project plan. Let's try that to our example.

Starting with the original plan

Then mark the second task as completed. This is now done by setting the remaining work of the task to 0. This make the following plan when leveling the resources at

 

This gives me exactly what I am looking for: it shows me where my critical path is and what the finish date for the project will be.

Implementation

To implement this solution, do the following steps

  1. Open the Visual Studio Command prompt (Start -> All Programs -> Microsoft Visual Studio 2008 -> Visual Studio Tools -> Visual Studio 2008 Command Prompt)

  2. Type "tfsfieldmapping download <tfsserver> <team project> <local file>, for example tfsfieldmapping download http://MyTfsServer:8080 MyTeamProject c:\temp\mapping.xml

  3. Open the downloaded file (in the example c:\temp\mapping.xml) in a xml editor (eg. in Visual Studio)

  4. Remove the line

    <

     

     

    Mapping WorkItemTrackingFieldReferenceName="Microsoft.VSTS.Scheduling.CompletedWork" ProjectField="pjTaskActualWork" ProjectUnits="pjHour" />

  5. Save the file

  6. Type "tfsfieldmapping upload <tfsserver> <team project> <local file>, for example tfsfieldmapping upload http://MyTfsServer:8080 MyTeamProject c:\temp\mapping.xml

  7. When you create a new MS Project and connect it to the TFS server, there is no synchronization of the completed work, so when you refresh the work items, only the remaining work will be updated and the completed work remains 0.

Tags:

VSTS 2008 | Work items

Make the description field formattable

by Ewald Hofman 4. August 2009 05:41

By default the description field in the work item definition (for example the Task work item), is plain text. To modify the type of the field to Html, you have to do the following:

Step Action
1 Open the command prompt (Run as Administrator)
2 Go to the folder %Program Files%\Microsoft Visual Studio 10.0\Common7\IDE
3

Export the work item with the following command:

witadmin exportwitd /s http:// <server> :<port>/<virtual directory>/<project collection> /p <team project> /n <work item type name> /f <location>
Example:
witadmin exportwitd /s http://MyTfsServer:8080/tfs/DefaultCollection /p TestProject /n Task /f c:\task.xml
4 Open the work item definition (in the example c:\task.xml) in Visual Studio or any other xml editor
5

Go to the FIELD

      <FIELD name="Description" refname="System.Description" type="PlainText">
        <HELPTEXT>What to do, pointers to resources and inputs, design notes, exit criteria</HELPTEXT>
      </FIELD>

6

You cannot change the type of an existing field, so just add a new field. Add a new FIELD section to the xml file:

      <FIELD name="DescriptionHtml" refname="Custom.DescriptionHtml" type="HTML">
        <HELPTEXT>What to do, pointers to resources and inputs, design notes, exit criteria</HELPTEXT>
      </FIELD>

7

Now change the field that is shown in the description textbox. Go to the section

<Control FieldName="System.Description" Type="HtmlFieldControl" Label="&amp;Description:" LabelPosition="Top" Dock="Fill" />

8

And change it to:

<Control FieldName="Custom.DescriptionHtml" Type="HtmlFieldControl" Label="&amp;Description:" LabelPosition="Top" Dock="Fill" />

9 Save the file
10

Import the new work item definintion with the command:

witadmin importwitd /s http:// <server> :<port>/<virtual directory>/<project collection> /p <team project> /f <location>
 
Example:
 
witadmin importwitd /s http://MyTfsServer:8080/tfs/DefaultCollection /p TestProject /f c:\task.xml

When you have completed the tasks, your new Task work item will look like:

 

Tags:

VSTS 2008 | VSTS 2010 | Work items

Change the file masks that are excluded by Source Control

by Ewald Hofman 2. August 2009 22:32

When you add files to Source Control, some of the files are excluded automatically, such as dll files.

 

You can change the default setting by modifying one of the following registry keys:

Per-User: HKCU\Software\Microsoft\VisualStudio\<version>\TeamFoundation\SourceControl\AddOptions
Per-Machine: HKLM\Software\Microsoft\VisualStudio\<version>\TeamFoundation\SourceControl\AddOptions

where <version> is the VS version:
For TFS2008 “9.0”
For TFS2010 "10.0"
 
If the value is not already there, add a string value titled “ExcludeMasks” and set it to the exclusion list you would like to use.  If this value if found, it overrides the built-in defaults.

 

Tags:

Version Control | VSTS 2008 | VSTS 2010

Remove ***NO_CI*** changesets from merge candidates

by Ewald Hofman 26. July 2009 23:34

A common scenario when you use TFS and Team Build, is that you want to update your build number during that process. There is the AssemblyInfoTask to accomplish that, but the downside of this approach is that it will create an extra changeset on every build. When you use a braching strategy, then it makes the merge process harder because there are these polluting ***NO_CI*** changesets.

Fortunately there is the possibility to discard these changeset from the merge candidate list. The application that is shown below let you remove those changesets automatically.

using System;
using System.Diagnostics;
using System.IO;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.VersionControl.Client;
 
namespace ConsoleApplication1
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            if (args.Length != 3)
            {
                Console.WriteLine(AppUsage());
                return;
            }
 
            const string tf = @"c:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\tf.exe";
            string tfsServer = args[0];
            string sourcePath = args[1];
            string targetPath = args[2];
 
            // Get a reference to our Team Foundation Server.           
            var tfs = new TeamFoundationServer(tfsServer);
 
            // Get a local path for the Tfs server. This is required by the TF command.
            string localPath = GetFirstLocalFolder(tfs);
 
            // Iterate through all merge candidates
            foreach (MergeCandidate candidate in GetMergeCandidates(tfs, sourcePath, targetPath))
            {
                // Skip all changesets that are not commented with ***NO_CI***
                if (candidate.Changeset.Comment != "***NO_CI***")
                    continue;
 
                // Discard the ***NO_CI changeset from the merge candidates
                Console.WriteLine(Execute(tf, localPath,
                                          string.Format("merge /discard /recursive /version:C{0} \"{1}\" \"{2}\"",
                                                        candidate.Changeset.ChangesetId, sourcePath, targetPath)));
                Console.WriteLine(Execute(tf, localPath,
                                          string.Format(
                                              "checkin /recursive /noprompt /comment:\"***NO_CI***\" /override:\"Discard the ***NO_CI*** changeset from the merge candidates.\" \"{2}\"",
                                              candidate.Changeset.ChangesetId, sourcePath, targetPath)));
            }
        }
 
        /// <summary>
        /// Displays how the app should be used.
        /// </summary>
        private static string AppUsage()
        {
            return "Start the application with 3 arguments: " + Environment.NewLine +
                   @"- The url of the Tfs Server (eg http:\\MyServer:8080" + Environment.NewLine +
                   @"- The path of the source branch (eg $/MyTeamProject/MySourceBranch)" + Environment.NewLine +
                   @"- The path of the target branch (eg $/MyTeamProject/MyTargetBranch)";
        }
 
        /// <summary>
        /// Returns the list of all merge candidates.
        /// </summary>
        private static MergeCandidate[] GetMergeCandidates(TeamFoundationServer tfs, string sourcePath,
                                                           string targetPath)
        {
            var versionControl = (VersionControlServer) tfs.GetService(typeof (VersionControlServer));
            return versionControl.GetMergeCandidates(sourcePath, targetPath,
                                                     RecursionType.Full);
        }
 
        /// <summary>
        /// Returns the local path of the first workspace.
        /// </summary>
        private static string GetFirstLocalFolder(TeamFoundationServer tfs)
        {
            var versionControl = (VersionControlServer) tfs.GetService(typeof (VersionControlServer));
            Workspace[] workspaces = versionControl.QueryWorkspaces(null, null, Environment.MachineName);
 
            return (workspaces.Length > 0 && workspaces[0].Folders.Length > 0)
                       ? workspaces[0].Folders[0].LocalItem
                       : null;
        }
 
        /// <summary>
        /// Runs the TF command
        /// </summary>
        private static string Execute(string fileName, string localPath, string arguments)
        {
            var pi = new ProcessStartInfo
                         {
                             FileName = fileName,
                             Arguments = arguments,
                             UseShellExecute = false,
                             ErrorDialog = false,
                             CreateNoWindow = true,
                             RedirectStandardOutput = true,
                             WorkingDirectory = localPath
                         };
 
            Process p = Process.Start(pi);
 
            // Read the redirected output.
            using (StreamReader sr = p.StandardOutput)
            {
                return sr.ReadToEnd();
            }
        }
    }
}

Tags: , ,

Team Build | Version Control | VSTS 2008

Automatically merge work item type modifications into existing team projects – part 3

by Ewald Hofman 21. July 2009 04:42

When you are working in an enterprise that has a lot of team projects, it is hard to make generic modifications to the work item types. Imagine that you want to add a field to all work item types in all team projects, first in the staging environment, then in the production environment. This means a lot of modifications!

Fortunately it is possible to automate this process. A work item type is nothing more then xml, what you can modify. This post shows you how you can automate this process. The post is divided into multiple parts:

  • Part 1: Download and upload the work item type from/to the TFS server
  • Part 2: Make the modifications to the work item type
  • Part 3: Add new elements to the work item type

In the first part, the base library is created to be able to download and upload the work item types from/to the TFS server. The second part added the ability to modify the attribute values of existing work item type elements. This part shows how you can enable adding new elements to work item types.

  1. Add a new class to the MergeWitModifications project and rename it to XPathAddition.cs.
  2. Add the following code to the class
  3. namespace MergeWitModifications
    {
        public class XPathAddition
        {
            /// <summary>
            /// The class that holds the name/value pair information for an attribute
            /// that is added to the node that will be added to the work item type.
            /// </summary>
            public struct Attribute
            {
                public string Name;
                public string Value;
            }
     
            /// <summary>
            /// The xPath of the parent where the node will be placed under.
            /// </summary>
            public string XPath { get; set; }
     
            /// <summary>
            /// The name of the new node.
            /// </summary>
            public string Name { get; set; }
     
            /// <summary>
            /// The list of name/value pairs that will be added to the new node.
            /// </summary>
            public Attribute[] Attributes { get; set; }
     
            /// <summary>
            /// Constructor.
            /// </summary>
            /// <param name="xPath">The xPath of the parent where the node will be placed under.</param>
            /// <param name="name">The name of the new node.</param>
            /// <param name="attributes">The list of name/value pairs that will be added to the new node.</param>
            public XPathAddition(string xPath, string name, Attribute[] attributes)
            {
                XPath = xPath;
                Name = name;
                Attributes = attributes;
            }
        }
    }
  4. Navigate to the Modifications class and replace the contents of the class to
  5. using System.Collections.Generic;
    namespace MergeWitModifications
    {
        public class Modifications
        {
            public Modifications()
            {
                XPathModifications = new List<XPathModification>();
                XPathAdditions = new List<XPathAddition>();
            }
     
            /// <summary>
            /// The list contains all modifications to the attribute values
            /// that must be done in the work item type.
            /// </summary>
            public List<XPathModification> XPathModifications { get; private set; }
     
            /// <summary>
            /// The list contains all additions to the work item type.
            /// </summary>
            public List<XPathAddition> XPathAdditions { get; private set; }
        }
    }
  6. To add the logic that adds the new elements to the work item type definition, add the following method to the AutoModifyWit class
  7. private static void ExecuteAddition(XmlDocument doc, XPathAddition addition)
    {
        // Get the parent node 
        var node = doc.SelectSingleNode(addition.XPath);
     
        // If the parent is existent, and the node does not exist already
        if (node != null && node.SelectSingleNode(string.Format("{0}[@{1}='{2}']", addition.Name, addition.Attributes[0].Name, addition.Attributes[0].Value)) == null)
        {
            // Create the node
            var childNode = doc.CreateElement(addition.Name);
     
            // And set the attribute values
            foreach (var attribute in addition.Attributes)
            {
                var xmlAttribute = doc.CreateAttribute(attribute.Name);
                xmlAttribute.Value = attribute.Value;
                childNode.Attributes.Append(xmlAttribute);
            }
     
            // Add the created node to the parent
            node.AppendChild(childNode);
        }
    }
  8. And add the code to call the ExecuteAddition method to the Start method. To do this, navigate now to the lines
  9. ///////////////////////////////////
    /// 
    /// TODO: Make the modifications to the work item type
    /// handled in part 2.
    /// 
    ///////////////////////////////////
  10. And add the following code

  11. foreach (var addition in modifications.XPathAdditions)
    {
        ExecuteAddition(doc, addition);
    }
  12. Now update the unit test to test the possibility to add new elements to the work item types. Navigate to the StartAutoModifyWit unit test.
  13. Add the following line to the unit test to add the start date to all work item types on the server.
  14.             modifications.XPathAdditions.Add(new XPathAddition("//Group[@Label='Schedule']/Column", "Control",
                                                             new[]
                                                                           {
                                                                               new XPathAddition.Attribute() {Name = "FieldName", Value="Microsoft.VSTS.Scheduling.StartDate"}, 
                                                                               new XPathAddition.Attribute() {Name = "Type", Value="FieldControl"},
                                                                               new XPathAddition.Attribute() {Name = "Label", Value="Start Dat&e:"},
                                                                               new XPathAddition.Attribute() {Name = "LabelPosition", Value="Left"},
                                                                               new XPathAddition.Attribute() {Name = "ReadOnly", Value="False"}
                                                                           }));

The library is not able to modify existing elements and add new ones to the work item types. You have now the base library which you can extend to your own needs.

Good luck.

Tags:

VSTS 2008 | Work items

Automatically merge work item type modifications into existing team projects – part 2

by Ewald Hofman 21. July 2009 03:38

When you are working in an enterprise that has a lot of team projects, it is hard to make generic modifications to the work item types. Imagine that you want to add a field to all work item types in all team projects, first in the staging environment, then in the production environment. This means a lot of modifications!

Fortunately it is possible to automate this process. A work item type is nothing more then xml, what you can modify. This post shows you how you can automate this process. The post is divided into multiple parts:

  • Part 1: Download and upload the work item type from/to the TFS server
  • Part 2: Make the modifications to the work item type
  • Part 3: Add new elements to the work item type

In the first part, the base library is created to be able to download and upload the work item types from/to the TFS server. This part continues on that base library and covers modifying the work item types based on XPath expressions.

The work item type definition consists of three parts. The first part is the the declaration of the fields that are available in the work item. The second part is the layout of the work item when it is presented in Visual Studio, or Team System Web Access. The last part is the work flow for the work item. The definition of the work item type is xml based.

Modifying work item types can be done by means of changing the attributes of existent nodes, by adding new nodes, or by removing nodes. The last (removing nodes) is not covered in this series. This part of the post will handle changing the attribute values.

  1. Start by adding a new class to the MergeWitModifications project that is created in the first part. Rename the class to XPathModification.
  2. Paste the following code into the XPathModification.cs file.
  3. namespace MergeWitModifications
    {
        public  class XPathModification
        {
            /// <summary>
            /// Constructor.
            /// </summary>
            /// <param name="xPath">The XPath expression to the attribute that should be modified.</param>
            /// <param name="newValue">The new value for the attribute.</param>
            public XPathModification(string xPath, string newValue)
            {
                XPath = xPath;
                NewValue = newValue;
            }
     
            public string XPath { get; private set; }
            public string NewValue { get; private set; }
     }
    }
  4. You have now created a class that holds the information to be able to change an attribute. Now add a new class that holds the list of all modifications.
  5. Add a new class to the project and call it Modifications.cs
  6. Paste the following code into the Modifications.cs file.
  7. using System.Collections.Generic;
    namespace MergeWitModifications
    {
        public  class Modifications
        {
            public Modifications()
            {
                XPathModifications = new List<XPathModification>();
            }
     
            /// <summary>
            /// The list contains all modifications to the attribute values
            /// that must be done in the work item type.
            /// </summary>
            public List<XPathModification> XPathModifications { get; private set; }
        }
    }
  8. Now it is time to create the logic to modify the work item type.
  9. Navigate to the Start method in the AutoModifyWit class and add the modifcations parameter to the method.
  10. Add a new method to the AutoModifyWit class called
  11.         /// <summary>
            /// Executes the modifications to the work items.
            /// </summary>
            /// <param name="modifications">The list of modifications that must
            /// be applied to the work item type.</param>
            /// <param name="teamProjects">The list of team projects that must be 
            /// modified. Pass null or the empty array when you want to update all 
            /// team projects.</param>
            /// <param name="workItemTypes">The list of work item types that must be 
            /// modified. Pass null or the empty array when you want to update all 
            /// work item types.</param>
            public void Start(Modifications modifications, string[] teamProjects, string[] workItemTypes)
  12. Add a new method to the class that will actually change the attribute value. To do this, navigate to the end of the AutoModifyWit class and add the following method
  13.         /// <summary>
            /// Performs the modification to the work item type definition.
            /// </summary>
            /// <param name="doc">The xml document that represents the work item type.</param>
            /// <param name="modification">The modification info.</param>
            private static void ExecuteModification(XmlDocument doc, XPathModification modification)
            {
                // Get the attribute at the XPath location
                var node = doc.SelectSingleNode(modification.XPath);
     
                if (node != null)
                {
                    // When found, modify the value of the attribute
                    node.Value = modification.NewValue;
                }
            }
  14. Navigate now to the lines
  15. ///////////////////////////////////
    /// 
    /// TODO: Make the modifications to the work item type
    /// handled in part 2.
    /// 
    ///////////////////////////////////
  16. And add the following code

  17. foreach (var modification in modifications.XPathModifications)
    {
        ExecuteModification(doc, modification);
    }
  18. Now that you have finalized the library to be able to modify a work item type, the unit test must be modified to test the code
  19. Navigate to the StartAutoModifyWit unit test that contains our "UI code".
  20. Change the call to the target.Start method to
  21. var modifications = new Modifications();
     
    target.Start(modifications, teamProjects, workItemTypes);
  22. To make the Start and Finish date writable for example you can add the following lines
  23. modifications.XPathModifications.Add(new XPathModification("//Control[@FieldName='Microsoft.VSTS.Scheduling.StartDate']/@ReadOnly", "False"));
    modifications.XPathModifications.Add(new XPathModification("//Control[@FieldName='Microsoft.VSTS.Scheduling.FinishDate']/@ReadOnly", "False"));

You have now added the functionality to modify existing elements in the work item type. The next post covers the ability to add new elements (field, layout and/or work flow) to the work item type.

Tags:

VSTS 2008 | Work items

Automatically merge work item type modifications into existing team projects – part 1

by Ewald Hofman 21. July 2009 03:09

Introduction

When you are working in an enterprise that has a lot of team projects, it is hard to make generic modifications to the work item types. Imagine that you want to add a field to all work item types in all team projects, first in the staging environment, then in the production environment. This means a lot of modifications!

Fortunately it is possible to automate this process. A work item type is nothing more then xml, what you can modify. This post shows you how you can automate this process. The post is divided into multiple parts:

  • Part 1: Download and upload the work item type from/to the TFS server
  • Part 2: Make the modifications to the work item type
  • Part 3: Add new elements to the work item type

This part of the post covers downloading and uploading the work item type from/to the TFS Server. The prerequisite is that you have installed Team Explorer onto the system that runs the application.

The application that is build, is making use of a library that wraps the functionality to communicate with the TFS server and perform the modifications to the work item type. There is a UI, which is in this case a unit test project, to tell the library what you want to change.

Preparations

  1. Open Visual Studio 2008 and create a new C# class library and call it MergeWitModifications.
  2. Add the following references to the project. The files can be found in the folder: %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies.
    - Microsoft.TeamFoundation.dll
    - Microsoft.TeamFoundation.Client.dll
    - Microsoft.TeamFoundation.Common.dll
    - Microsoft.TeamFoundation.WorkItemTracking.Client.dll
  3. Rename the Class1.cs file to AutoModifyWit.cs
  4. Paste the following code to the file:
  5. using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Diagnostics;
    using Microsoft.TeamFoundation.Client;
    using System.Net;
    using Microsoft.TeamFoundation.WorkItemTracking.Client;
    using System.Xml;
     
    namespace MergeWitModifications
    {
        struct Info
        {
            public string Project { get; set; }
            public string WorkItemType { get; set; }
        }
        
        public class AutoModifyWit
        {
            /// <summary>
            /// Creates a new instance of this class.
            /// </summary>
            /// <param name="tfsServer">The uri to the tfs server, in the form 
            /// of http://MyTfsServer:8080.</param>
            public AutoModifyWit(string tfsServer)
            {
                TfsServer = tfsServer;
            }
     
            /// <summary>
            /// The uri to the TFS server that contains the work item types that
            /// will be modified
            /// </summary>
            private string TfsServer { get; set; }
     
            /// <summary>
            /// Executes the modifications to the work items.
            /// </summary>
            /// <param name="teamProjects">The list of team projects that must be 
            /// modified. Pass null or the empty array when you want to update all 
            /// team projects.</param>
            /// <param name="workItemTypes">The list of work item types that must be 
            /// modified. Pass null or the empty array when you want to update all 
            /// work item types.</param>
            public void Start(string[] teamProjects, string[] workItemTypes)
            {
                // The base folder where the backup of the work item type definition 
                // will be stored.
                string backupDirectory = string.Format(@"{0}\Backup{1:yyyyMMddhhmm}\", Directory.GetCurrentDirectory(), DateTime.Now);
     
                // Iterate through all work item types in all team projects. When
                // you do this without creating a new tfs instance, a write
                // access violation will occur (a bug in the TFS SDK?)
                foreach (var info in GetAllWITs())
                {
                    // Check whether the team project and/or the work item type should be skipped
                    if ((teamProjects != null && teamProjects.Length != 0 &&
                         !new List<string>(teamProjects).Contains(info.Project)) ||
                        (workItemTypes != null && workItemTypes.Length != 0 &&
                         !new List<string>(workItemTypes).Contains(info.WorkItemType)))
                        continue;
     
                    Debug.WriteLine(info.Project + ", " + info.WorkItemType);
     
                    // Open the work item store
                    using (var tfs = new TeamFoundationServer(TfsServer,
                                                              CredentialCache.DefaultCredentials))
                    {
                        var store = (WorkItemStore) tfs.GetService(typeof (WorkItemStore));
     
                        // For the Team Project
                        var project = store.Projects[info.Project];
     
                        // For the Work Item Type
                        var workItemType = project.WorkItemTypes[info.WorkItemType];
     
                        // Download the work item type from the server
                        var doc = workItemType.Export(false);
     
                        // Backup the original work item type to support a fallback scenario
                        Directory.CreateDirectory(backupDirectory + @"\" + info.Project);
                        doc.Save(backupDirectory + @"\" + info.Project + @"\" + info.WorkItemType + @".xml");
     
                        ///////////////////////////////////
                        /// 
                        /// TODO: Make the modifications to the work item type
                        /// handled in part 2.
                        /// 
                        ///////////////////////////////////
     
                        // Validate the modifications to the work item type
                        WorkItemType.Validate(project, doc.OuterXml);
     
                        // Upload the work item type to TFS
                        project.WorkItemTypes.Import(doc.OuterXml);
                    }
                }
            }
     
            /// <summary>
            /// Returns the list of all available work item types on the server
            /// </summary>
            private List<Info> GetAllWITs()
            {
                var list = new List<Info>();
     
                // Open the work item store
                using (var tfs = new TeamFoundationServer(TfsServer,
                                                          CredentialCache.DefaultCredentials))
                {
                    var store = (WorkItemStore) tfs.GetService(typeof (WorkItemStore));
                    // For all Team Projects
                    foreach (Project project in store.Projects)
                    {
                        // For all Work Item Types
                        foreach (WorkItemType workItemType in project.WorkItemTypes)
                        {
                            // Add the work item type
                            list.Add(new Info
                                         {
                                             Project = project.Name,
                                             WorkItemType = workItemType.Name
                                         });
                        }
                    }
                }
     
                return list;
            }
        }
    }
  6. Right click on the line “public void Start(string[] teamProjects, string[] workItemTypes)” and choose for the option Create Unit Tests…
  7. A dialog pops up after a while. In there you can choose the settings for the new test project. Accept the defaults by clicking on the OK button. You can name the project MergeWitModificationsTest.
  8. Paste the following code in the AutoModifyWitTest.cs file.
  9. using MergeWitModifications;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    namespace MergeWitModificationsTest
    {
        
        
        /// <summary>
        ///This is a test class for AutoModifyWitTest and is intended
        ///to contain all AutoModifyWitTest Unit Tests
        ///</summary>
        [TestClass()]
        public class AutoModifyWitTest
        {
            /// <summary>
            /// Starts the modifications of the work item types.
            ///</summary>
            [TestMethod()]
            public void StartAutoModifyWit()
            {
                // The server that contains the work item types that must be modified
                const string tfsServer = "http://MyTfsServer:8080";
     
                // The list of team projects that must be modified. Pass null or the 
                // empty array when you want to update all team projects.
                var teamProjects = new string[] { };
     
                // The list of work item types that must be modified. Pass null or the 
                // empty array when you want to update all work item types.
                var workItemTypes = new string[] { };
     
                var target = new AutoModifyWit(tfsServer);
     
                target.Start(teamProjects, workItemTypes)
            }
        }
    }

You have now created the base of the library. The library is not able to communicate with the TFS server to download and upload work item types. In the next part the library will be extended to modify the work item type with XPath expressions.

Tags:

VSTS 2008 | Work items

Improve performance TSWA

by Ewald Hofman 16. July 2009 23:49

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:

    <caching>
       <cache disableMemoryCollection = "false" disableExpiration = "false" privateBytesLimit = "1000000000" percentagePhysicalMemoryUsedLimit = "60" privateBytesPollTime = "00:02:00"/>
    </caching>

  • Disable debugging in the web.config file. Having debugging turned on caused virtual memory leaks.
  • Finally, you can set the VM bytes limit to recycle the app pool to 1.9 GB; that will enable automatic recycling once the app pool consumes all available memory.

 

kick it on DotNetKicks.com

Tags:

TSWA | VSTS 2008

Time Entry report

by Ewald Hofman 9. July 2009 00:55

A frequently heard complaint about using the time fields in the work item is that there is already another system in the organization to enter the working hours in. Using the time fields in the work item would mean a double time management system, which can be out of sync.

To come around this, I created a new report that reads from the work items how many hours a developer has entered for a specific day. The report you can use is attached to the blog.

Time Entry.rdl (18.21 kb)

Tags:

Reporting | VSTS 2008

Clear the cache of TFS

by Ewald Hofman 6. July 2009 11:53

When there are problems that are related to source control or anything else with Team Explorer, the first step to resolve the issue is to clear the cache. You can do that by emptying the C:\Documents and Settings\[USER]\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache folder on your development machine.

Tags:

VSTS 2008

Recover security settings

by Ewald Hofman 3. July 2009 02:05

It is possible in Version Control to override the security settings per folder. To do that uncheck the "Inherit security settings" and you can add, modify and remove the permission.

When you accidently remove all accounts from the list, then it is not possible to view the contents of the folder for any user, nor change the security settings. This is even the case for a Server Administrator.

To recover from this situation, you have to access Version Control with the TFSSETUP service account.

Tags: , , ,

Version Control | VSTS 2008

Powered by BlogEngine.NET 1.6.1.0
Theme by Mads Kristensen


ClusterMap

Statistics

Statistics created at 09 Sep 2009

121 posts
492 comments
326 raters
1913833 visit (1041 per day)
18 users online

Recent comments

Comment RSS