A Tech Log

May 27, 2009

Mapping of MS-Project fields to TFS – Walkthrough

Filed under: Development — adallow @ 10:48 am
Tags:

see http://developers.de/blogs/damir_dobric/archive/2008/06/23/mapping-of-ms-project-fields-to-tfs.aspx

Customizing Microsoft Project Field Mappings

Filed under: Development — adallow @ 10:02 am
Tags:

From MSDN:

When publishing or refreshing tasks in Microsoft Project, there is a mapping file that specifies how the fields in each task are mapped to fields in Team Foundation. Also the mapping file controls the publishing behavior, and designates special fields that display additional information, such as the context field.

You can customize the behavior when tasks are published or refreshed. You can change which fields in Team Foundation are mapped to Microsoft Project fields. You can control if fields are only published, or both published and refreshed. And you can designate special fields that are the links and attachments, context field, and synchronization field.

The Microsoft Project Field Mapping File
Describes the Microsoft Project mapping file and explains the XML syntax with examples.

Field Mappings in Microsoft Project
Provides specific support information for understanding how Team Foundation fields and Microsoft Project fields can be mapped.

How to: Download or Upload a Microsoft Project Field Mapping File
Explains how to download or upload the Microsoft Project field mapping file for a team project.

How to: Change How Fields are Mapped to Microsoft Project
Explains how to change field mappings in the Microsoft Project field mapping file.

May 8, 2009

TFS Workitem CoreField Enum

Filed under: Development — adallow @ 11:09 am
Tags:

TFS WorkItems CoreField enum can be used to access various fileds in a work item. For example

workItem.Fields[CoreField.AssignedTo].Value = "Emma Smith";

The values for this enum are as below:
Id
Rev
Title
Description
WorkItemType
TeamProject
State
Reason
CreatedBy Can be a user other than the one who is authenticated. See AuthorizedAs.
AssignedTo
ChangedBy
ChangedDate
CreatedDate
RevisedDate
AuthorizedAs The “person name” field, used to store the name of the user who is authenticated to make the change.
History
AreaPath
AreaId
IterationPath
IterationId
NodeName
RelatedLinkCount
HyperLinkCount
AttachedFileCount
ExternalLinkCount

April 1, 2009

Moving TFS Databases

Filed under: Development — adallow @ 10:17 am
Tags:

from: http://weblogs.asp.net/dmckinstry/archive/2006/12/04/moving-tfs-databases.aspx

TFS was down!  The problem appeared to be that the TFS databases were installed on the default C drive which was too small and completely out of space.  They were pretty sure they knew the answer but wanted me to verify it.  For everyone’s benefits, I’ve documented the steps we used to move the TFS-related databases from the C drive to another location.

Note that they were already at a stop-work situation so things couldn’t get too much worse.  If you need to do something similar you should approach the process gingerly.  Make sure your backups are good and realize that while you’re doing this the TFS and its related services will be unavailable.

  1. Stop TFSServerScheduler, SharePoint Timer Service & SQL Server Reporting services..
    • Right-click on “My Computer” in the start menu and select Manage.
    • Drill into Services and Applications > Services.
    • Locate and stop the aforementioned services.
  2. Stop the TFS-related Application Pools:  ReportServer, TFS AppPool, TFSWSS, and TFSWSSADMIN.  As an alternative, you may simply shut down IIS altogether if it isn’t being used for anything else on the system.  Also note that these application pools
    • Still within Computer Management, drill into Services and Applications > Internet Information Services > Application Pools
    • Right click on the aforementioned pools and select Stop.
  3. Open Microsoft SQL Server Management Studio (Start > All Programs > Microsoft SQL Server 2005 > SQL Server Management Studio) and connect to the Database Engine for your Team Foundation Server.
  4. Drill into the Databases node.
  5. Locate and Detach the TFS databases.  To do this, right-click on the database and select Tasks > Detach…  Click OK to detach the database.  You can selectively choose the individual databases that you need to move or simply move all of the following:
    • ReportServer
    • ReportServerTempDB
    • STS_Config_TFS
    • STS_Content_TFS
    • TfsActivityLogging
    • TfsBuild
    • TfsIntegration
    • TfsVersionControl
    • TFSWarehouse
    • TfsWorkItemTracking
    • TfsWorkItemTrackingAttachements
  6. Locate the database data files and transaction logs that were detached.  By default they are in the following directory: C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data.  The following database files are candidates based on the same sort order shown in the previous list:
    • ReportServer.mdf and ReportServer_log.LDF
    • ReportServerTempDB.mdf and ReportServerTempDB_log.LDF
    • STS_Config_TFS.mdf and STS_Config_TFS_log.LDF
    • STS_Content_TFS.mdf and STS_Content_TFS_log.LDF
    • TfsActivityLogging.mdf and TfsActivityLogging_log.LDF
    • TfsBuild.mdf and TfsBuild_log.LDF
    • TfsIntegration.mdf and TfsIntegration_log.LDF
    • TfsVersionControl.mdf and TfsVersionControl_log.LDF
    • TFSWarehouse.mdf and TFSWarehouse_log.LDF
    • TfsWorkItemTracking.mdf and TfsWorkItemTracking_log.LDF
    • TfsWorkItemTrackingAttachments.mdf and TfsWorkItemTrackingAttachments_log.LDF
  7. For each database, move the MDF and related LDF file from the source location to your selected destination.
  8. Return to Microsoft SQL Server Management Studio, reattach the database files in their new locations.  You can do this as follows:
    • Right-click on the Database folder and selecting Attach…
    • Click the Add button.
    • Browse to the new location and select the first MDF that you’ve moved and click OK.
    • Repeat steps 2 and 3 to select all of the database files that you’ve moved.
    • Once all of your databases are selected, click OK in the Attach Databases dialog.
    • Verify that all of the original databases shown in step 5 above are displayed under the Databases folder in SQL Server Management Studio.
    • Close SQL Server Management Studio.
  9. Restart the application pools that were shutdown in step 2.  You can use the same steps from step 2 except that you select Start from the pop-up menu instead for Stop.
  10. As a good measure, after the application pools are restarted, I restart IIS itself.  This probably isn’t necessary but I am paranoid.  If taking IIS down on your TFS server doesn’t work in your environment, skip this step.  To restart IIS, right-click on the Internet Information Services node in the computer Management console and select All Tasks > Restart IIS…  If you opted to take IIS down as a whole in step 2, now is the time to restart it.
  11. Start the services that were stopped in step 1.  This process is again the same as that given in step 1 except no you are starting services instead of stopping them.
  12. Bring up Team Explorer and verify that everything works.  Make sure you check the work items, reports and team portals to make sure everything looks good.
  13. Take a peek at the Application and System event logs and make sure that nothing unusual happened during your testing of the new environment.

March 31, 2009

TFS Excel addin problem

Filed under: Development — adallow @ 5:27 pm
Tags:

Problem:

Error TF84037: There was a problem initializing the Microsoft Excel Team Foundation Addin.  Re-installing the Team Foundation Client may be required.

Solution:

Office 2003 .Net programmability support is not installed.  You need to modify your installed version of Office and install this option.  I thought we had a better error message for this…

1.  In Add/Remove programs, locate your Office application and select it.

2.  Click on the ‘Change’ button

3.  Select ‘Add or Remove features’ and click ‘next’

4.  Select ‘Choose advanced customization of applications’ and click ‘next’

5.  In the tree view, expand ‘Microsoft Office Excel’ and make sure the .NET Programmability Support option is set to ‘run from my computer’.

6.  Click ‘update’.

from MSDN

March 17, 2009

Delete Workitem in TFS (including the TFS data warehouse)

Filed under: Development — adallow @ 9:13 am
Tags:

taken directly from: http://bappedyanto.com/post/Delete-Work-Item-in-TFS.aspx

In TFS 2008, there’s a capability to delete unused work item. I know some people think that physically delete the work item is not needed because there are several work around to achieve it, nevertheless for the reason of tidiness everything, delete work item physically sometimes is required.

Out of the box, this feature is not available. You need to install TFS 2008 Power Tools and use the TFPT.EXE command line tools (although I believe GUI will be more than useful).

image

Be careful now, there’s no way to recover or undelete the work item by executing this tool.

As the description suggest, using this tool is not deleting records in datawarehouse (TFS uses SQL Server both OLTP and OLAP), only in operational database. The implication is the deleted work item will still appear in Team Reporting.

To fix this, manual deletion is required in TFS Datawarehouse database, some people will say that this practice is dangerous because potentially will break the data integrity but I think if we do it properly, the risk can be eliminated.

in SQL Management Studio, connect to TFS Database Server, and then unfold TFSWarehouse database.

image

Notice five tables with name related to work item. [Current Work Item], [Work Item], [Work Item Changeset], [Work Item History], and [Work Item with Result].

Query [Work Item] table to get the work item id in Datawarehouse with this SQL statement

SELECT __ID, System_Title FROM [Work Item] WHERE System_Id = workitemid

workitemid in here is the work items id that is used in TFPT command. Don’t get confused because in other 4 tables that previously noted the work item id that will be used is coming from [Work Item].__ID.

For the other 4 tables here’s the SQL statement that need to be executed

Delete [table name] where [work item] = workitem_from_[Work Item].__ID

Then rebuilt you cube by executing the OLAP Database and Warehouse Run from web services.

Disclaimer : please be very careful when conducting this procedure. I am not responsible if your TFS data is messed up

January 29, 2009

TFS API: Work ItemHistory

Filed under: Development — adallow @ 2:49 pm
Tags:

http://crazedcodemonkey.blogspot.com/2008/06/team-foundation-server-api-provides.html

January 27, 2009

MSBuild: Best Practices For Creating Reliable Builds, Part 1

Filed under: Development — adallow @ 4:40 pm
Tags: ,

If your using MSBuild (as we do with our TFS environment) then the following is most useful:

http://msdn.microsoft.com/en-au/magazine/dd419659.aspx

Team Foundation Server Power Tools – October 2008 Release

Filed under: Development — adallow @ 11:55 am
Tags:

Includes:

  • Command line tool (TFPT.EXE)
  • Team Explorer IDE menu additions
  • Build Notification tool
  • TFS Best Practices Analyzer
  • Process Template Editor
  • Work Item Templates
  • Custom check-in policies
  • TFS Server Manager
  • TFS Users tool
  • Alert Editor
  • TFS Power Shell Extensions
  • TFS Windows Shell Extensions
  • Team Members Tool

Download from: http://www.microsoft.com/downloads/details.aspx?familyid=FBD14EEA-781F-45A1-8C46-9F6BA2F68BF0&displaylang=en

Checking your TFS Version

Filed under: Development — adallow @ 11:52 am
Tags:

see http://blogs.msdn.com/bharry/archive/2008/01/15/checking-your-tfs-version-and-extending-trials.aspx

“The program is called TFSVersionDetection.exe and is attached to this blog post (use link above). I recommend that you run the tool on the TFS server itself. You can run it from another machine and point it at the TFS server but it does a less thorough job of detection (due to permissions issues, etc). If you run it on the TFS server and press the “Check” button, you will see a screen that look something like the following.”

Visual Studio 2008 Team Foundation Server Service Pack 1

Filed under: Development — adallow @ 11:49 am
Tags:

http://www.microsoft.com/downloads/details.aspx?familyid=9e40a5b6-da41-43a2-a06d-3cee196bfe3d&displaylang=en

January 24, 2009

TFS Branching Guide 2.0

Filed under: Development — adallow @ 6:32 am
Tags: ,

Jeff Beehler: “Selecting the right branching strategy is one of the most important aspects of TFS deployment. Picking the right strategy can lead to optimized team cooperation, increased productivity and a successful adoption. On the other hand, selecting a bad branching strategy can cause frustration, damage productivity and derail TFS adoption in an organization. We have therefore put a lot of effort in creating a set of practical guidance to educate our customers and partners and support their VSTS adoption efforts.”

You can see the guide at (came out late dec 2008):

http://www.codeplex.com/TFSBranchingGuideII

December 17, 2008

MSBuild Copying Files

Filed under: Development — adallow @ 4:49 pm
Tags: ,

http://blogs.parivedasolutions.com/borrell/archive/2007/05/19/MSBuildMultipleDeployments.aspx

http://borrell.parivedasolutions.com/2007/05/msbuild-copy-files-to-multiple-folders.html

http://blogs.msdn.com/msbuild/archive/2005/11/07/490068.aspx

http://www.sedodream.com/PermaLink,guid,8f6bbb30-ec22-4fc6-90a1-c32715598d23.aspx

Executing Unit Tests from MSBuild

Filed under: Development — adallow @ 4:45 pm
Tags: ,

http://geekswithblogs.net/michaelstephenson/archive/2007/04/27/112031.aspx

http://social.msdn.microsoft.com/forums/en-US/msbuild/thread/e0c8ceec-f180-43cd-b92b-c37c3991c169/

http://harriyott.com/2005/07/running-mstest-from-msbuild.aspx

http://paltman.com/2006/12/06/3-steps-to-integrating-cruisecontrol-with-msbuild-mstest-and-code-coverage/

TFS Deployer

Filed under: Development — adallow @ 4:44 pm
Tags:

By way of explaination, TFS Deployer interfaces the Team Foundation Server build store with PowerShell allowing script execution to be triggered across multiple machines when a user transitions the quality indicator of a build from one state to another.

http://www.codeplex.com/tfsdeployer

November 18, 2008

C9 Video – TFS Power Toys

Filed under: Development — adallow @ 11:37 pm
Tags:
A closer look at tfs power toys:

More new toys:

C9 Video – Better Project Management with Team Foundation Server

Filed under: Development — adallow @ 11:30 pm
Tags:

TFS / Project Server 2007 Connector Video

Filed under: Development — adallow @ 11:17 pm
Tags: ,

November 14, 2008

TFS: Creating Custom Work Item Controls with .Net

Filed under: Development — adallow @ 9:58 am
Tags:

see:

http://msmvps.com/blogs/vstsblog/archive/2007/07/07/starting-using-custom-work-item-controls.aspx

TFS: Changing email notifications to link to Team System Web Access

Filed under: Development — adallow @ 9:57 am
Tags:

from: http://msmvps.com/blogs/vstsblog/archive/2007/08/31/changing-tfs-email-notifications-to-link-to-team-system-web-access.aspx

  1. On the TFS app tier open the folder:
    %ProgramFiles%\Microsoft Visual Studio 2005 Team Foundation Server\Web Services\Services\v1.0\Transforms
  2. Create a backup of the file WorkItemChangedEvent.xsl, which we will be editing in the next step.
  3. Replace the text:

    <xsl:value-of select=”DisplayUrl” />

    with:

    <xsl:value-of select=”concat(substring-before(DisplayUrl,’:8080/WorkItemTracking/WorkItem.aspx?artifactMoniker=’),’:8090/wi.aspx?id=’,substring-after(DisplayUrl,’artifactMoniker=’))” />

    The bold printed 8090 is the port where you installed TSWA at.

  4. Save the file and you are done.

If you now get a new notification e-mail and click on the link you’ll see the following much nicer work item details form provided by TSWA:

Team System Web Access Work Item Detail Form

TFS: SDK Online Doco

Filed under: Development — adallow @ 9:54 am
Tags:

From the contents:

  • Team Foundation Server Extensibility
  • Team Foundation Server SDK Architecture
  • How to: Run Team Foundation Server SDK Samples
  • Team Foundation Core Services
  • Work Item Tracking Extensibility
  • Source Control Extensibility
  • Data Warehouse Extensibility
  • Reference for Team Foundation Server SDK

Link: http://msdn2.microsoft.com/en-us/library/bb130146(VS.80).aspx

November 13, 2008

Connecting Project Server 2007 to TFS

Filed under: Development,Enterprise & Application Architecture — adallow @ 12:42 pm
Tags: ,

There is an open source project on codeplex that provides a connector between ProjectServer and TFS. We are big users of TFS and are thinking about extending our PM function with ProjectServer so this could be very useful going forwards.

See: http://www.codeplex.com/pstfsconnector

November 12, 2008

TFS: Branching and Merging Video

Filed under: Development,Enterprise & Application Architecture — adallow @ 9:59 am
Tags: ,

“The ability to branch and merge source code with Visual Studio Team Foundation Server can really enable a team to build software in a more agile and maintainable manner. But choosing the best branching strategy can be a bit overwhelming at first. In this interview we ask Doug Neumann, Group Program Manager for Team Foundation Server, to give us a Branching and Merging primer.” (from MS channel 9)

see the video guidance: http://channel9.msdn.com/posts/Rory/Branching-101-with-Doug-Neumann-Visual-Studio-Team-Foundation-Server/

November 10, 2008

TFS: Work Item Hierarchy using a custom control

Filed under: Development — adallow @ 11:50 am
Tags:

This TFS Custom control for Work Items (requires SP1) allows setting a parent work item, displays parent work item as well as a child hierarchy and prevents closing a parent when any child work items are not closed.

http://www.codeplex.com/WorkItemHierarchy

TFS: LINQ-To-TFS

Filed under: Development — adallow @ 11:48 am
Tags: ,

An initial implementation, capable of executing simple WIQL queries against the Work Item Store of a TFS server:

http://www.codeplex.com/LinqTfs

TFS to Heat ITSM

Filed under: Development — adallow @ 11:45 am
Tags:

Early stages, but there is a release, and it could be a useful base to start from:

http://www.codeplex.com/TFSHeatITSM

TFS: Process Customisation

Filed under: Development — adallow @ 11:36 am
Tags:

customise and edit work items and process templates (add/edit fields):

http://www.silicusblogs.com/kb/software-development-practices/process-implementation-and-tfsteam-foundation-server.html

TFS: Getting workitem history from the api

Filed under: Development — adallow @ 11:14 am
Tags:

First get the workitem in code (as per TFS code samples) then:

foreach(Revision rev in wrkitem.Revisions)

{

foreach(Field f in rev.Fields)

{

Console.WriteLine(“{0} = {1}\n”,f.Name,f.Value);

}

}

There is also the OriginalValue property on fields as an alternative (for some styles of history access):

foreach(Field f in rev.Fields)
{
if(!Object.Equals(f.Value, f.OriginalValue))
{
Console.WriteLine(“{0}: {1} -> {2}”, f.Name, f.OriginalValue, f.Value);
}
}


November 4, 2008

TFS: Scrum for Team System Track Actual Worked Hours

Filed under: Development — adallow @ 12:53 am
Tags: ,

DylanSmith had an interesting forum comment on the SFTS website

He tracks actual time using the SFTS template through appropriate use of the Estimated Effort and Work Remaining fields.  The idea is that if you want to enter X hours of actual time against a SBI you have to decrease the Work Remaining by Y and/or increase the Estimated Effort by Z such that Y+Z == X.

For example, lets say I had an SBI with an Estimated Effort (EE) of 5 hours, and a Work Remaining (WR) of 5 hours.

Day 1: Actual time spent on SBI is 3 hours.  Change WR to 2.  (Y = 3, Z = 0, Y+Z = 3).

Day 2: Actual time spent on SBI is 3 more hours, and I’m still not complete, probably about 1.5 hours remaining still on this SBI.  Change WR to 1.5, Change EE to 7.5 (Y = 0.5, Z = 2.5, Y+Z = 3).

Using this method I can report on actual time, it is simply EE – WR.

November 3, 2008

TFS: Scrum for team system, why some reports don’t seem to work.

Filed under: Development — adallow @ 11:33 pm
Tags: , ,

from the SfTS website:

Here are some standard reasons why the reports do not appear to work:

  • Warehouse Syncronisation
    The Scrum for Team System reports are generated by SQL Reporting server which uses the TFS warehouse database as it’s data source. By default, the warehouse database is only updated with the work item tracking data every hour. This means that it will take at least an hour before changes made to work items are reflected in the reports.
  • Overnight Update
    Some reports plot lines using the delta between days, so no data will be visible until the following day.
  • No Sprint Data
    Sprints must have a start and end date before they can be viewed in reports.

October 30, 2008

TFS Work Item Bulk Editing

Filed under: Development — adallow @ 4:15 am
Tags:

Using the TFS power toys, and ‘Work Item Templates’ you can do bulk updates of work items in TFS.

see: http://blogs.msdn.com/teams_wit_tools/archive/2007/10/05/tfs-power-tools-release-work-item-templates-bulk-edit.aspx

TFS Rosario: Hierarchical Work Items

Filed under: Development — adallow @ 2:52 am
Tags: ,

Some interesting info on the next version of TFS, which will make hierarachical work item management easier:

TFS Hierarchical Work Items

TFS Hierarchical Work Items

see: http://www.holliday.com.au/resource/WindowsLiveWriter/TFSRosarioFeedbackHierarchicalWorkItems_10690/rosario_wbs.jpg?fileId=954920

October 29, 2008

Deleting multiple TFS workitems at once

Filed under: Development — adallow @ 11:40 pm
Tags:

In TFS 2008, there’s a capability to delete unused work item via a command line tool (TFPT.EXE) provided by the TFS 2008 Power Tools.

See following: http://www.bappedyanto.com/post/Delete-Work-Item-in-TFS.aspx

October 16, 2008

App & Source Code to Update your TFS Warehouse

Filed under: Development — adallow @ 4:04 am
Tags:

Eric Lee has an intersting post where he provides teh source code to an app that you can use to update your TFS Warehouse. Its at:

http://blogs.msdn.com/ericlee/archive/2006/07/09/660993.aspx

TFS: Empty reports if you delete and recreate a project with the same name

Filed under: Development — adallow @ 3:47 am
Tags:

I am using TFS 2008 and if I delete a project using TFSDeleteProject.exe and recreate another with exactly the same name then all the TFS reports are blank. The solution is to not recreate the project with the same name (I tried rebuilding the warehosue but that did not seem to help in my case):

“The warehouse is a historical repository, and it will retain information about projects even after they are deleted from the operational stores.”

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=187231&SiteID=1

Deleteing a TFS Project

Filed under: Development — adallow @ 3:42 am
Tags:

To delete a TFS project, you can use teh command line tool TfsDeleteproject.exe which is normally found in ‘C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE’ directory.

Open a command promt, CD to that directory and then issue teh following command:

tfsdeleteproject /server:http://MyServer:8080 MyProjectName

Obviously change teh MyServer to be the name of your server and the MyProjectName to be the name of your project.

But if you do delete a project don’t recreate another project afterwards with the same name, I’ll cover why in another post.

Create a free website or blog at WordPress.com.