DCSIMG
Asaf Vishna

Asaf Vishna

This blog will focus on Team System, configuration management, development and QA methodologies.

Create new Team Project with a name of already deleted Team Project name

One of the customers that I work with have deleted a Team Project from the TFS collection,  when he have tried to create a new Team Project on the same collection he got an error":

Test settings 'Local Test Run' already exists. Test settings must be unique per team project.”

The log file included the following information (which didn’t give any new information): 

Exception Message: Test settings 'Local Test Run' already exists. Test settings must be unique per team project. (type SoapException)SoapException Details: <detail xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ExceptionProperties xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><property name="ERRORCODE"><value xsi:type="xsd:int">0</value></property></ExceptionProperties></detail>”

Searching for information about this error and how to resolve it I found the following methods:

  1. Removing all of the temp files in C:\Users\[UserName]\AppData\Local\Microsoft\Team Foundation\3.0\Cache
  2. Recreate the Team Project with a different user account on a different machine.
  3. Restart of the TFS application machine

I have tried both method 1 and 2 but with no success, I still got the same error when I tried to create the Team Project. Only after the TFS Application machine was restarted I could create a new Team Project with the old name.

New videos on the MSDN about TFS2010 and VS2010 ALM

In the latest blog from Esther Fan she wrote about MSDN videos that show how you can use Visual Studio ALM tools and Team Foundation Server to help your team develop software more successfully ( for the full blog new videos from MSDN).

Few section I want to highlight:

Testing

For more information about these topics, see Testing the Application in the MSDN Library.

Team Foundation Server

For more information, see the following topics in the MSDN Library:

Lab Management

For more information, see Using a Virtual Lab for Your Application Lifecycle in the MSDN Library.

Team Foundation Server 2010 and Project Server 2010 Integration Virtual Machine.

As the officially Team Foundation Server 2010 and Project Server Integration Feature Pack was released, to help people evaluate and demonstrate the capabilities of this integration, Microsoft have published a virtual machine which is pre-configured with this integration along with sample data and several walkthroughs (which can either be used as self-paced hands-on-labs, or demo scripts to present these capabilities to others).

Beware that the virtual machine download contains 20+ files weighing in at over 10GB, there is only support for Windows Server 2008 Hyper-V (as far as I found).

The good news is that once you have the virtual machine there’s not much left to configure, you can open it begin exploring this integration using the guided walkthroughs. Microsoft® Team Foundation Server® 2010 and Microsoft Project Server® 2010 Integration Hyper-V Virtual Machine

“Working with the Project Server 2010 and Team Foundation Server 2010 Integration Virtual Machine.docx” - provides more details about how to load this virtual machine within Hyper-V, and how to activate the operating system to get a full 180 days of usage from this virtual machine. (After 180 days from the time you first boot the virtual machine it will expire)

The download includes 4 documents that you can use as walkthroughs to learn more about the scenarios enabled by this integration.

  • Top-Down Planning of Business Requirements with Project Server and Team Foundation Server.docx
  • Managing Project Details in an Enterprise Project Plan Mapped to a Team Project.docx
  • Making Agile Team Progress Visible to the Project Management Office.docx
  • Managing Field Mappings for Integration of Team Foundation Server and Project Server.docx

You can read more about this integration in Brian Keller blog and Brian Harry

How to resolve TF20015: The field {Field Name} contains the value {Value} that is not in the list of supported values

I got a call from one of my customers that when a user is trying to open work item he get the error- image

From looking inside the template of the work item I saw that the filed have a rule of VALIDUSER, from further investigation I found that the user was renamed from Cathy Smith –> Cathy Jones.

Each team the work item was opened the value “Cathy Smith” was thrown as an error since the user “Cathy Smith” didn’t exist anymore.

The solution to the problem was to add to the field the rule ALLOWEXISTINGVALUE, This rule allows a previously entered value to still be valid even if that value is no longer a valid value.

Create document report from TFS data

 

After a while of working with TFS work item, a lot of data is been assembled inside the TFS. This data can be access by the TFS quire and even can be exported into Excel sheet, but what about exporting the data into Word document?

There are a few tools in the market that you can use to export the data to Word document but none of this tools will export the data and will generate the report with the correct hierarchy format that will represent the hierarchy of the data and will also will create the report using a few general roles on the data.

With the great help of Lior Amsalem we created a project which purpose is to auto generate documents that are related to any type of data stored on the TFS. The documents can be tailored documents according to TFS specific data, or standard reports that are required by regularity needs (FDA, ISO or…), or internal company's development documents (STD, STR, Project Plan…).

The project is based on a few layers

  • DAL - The system is using a layer that connects to TFS on top of the TFS APIs and handles all communication and data retrieval from the TFS.
  • BL - There is a reporting data layer which is responsible to build custom data structures according to the reports we need.
  • UI – The actual reports generation is using OPEN XML SDKs in order to generate any type of office documents (Word, Excel…).

 

For example in one of the company that I advise for, they MUST produce a document that describes the requirement from the product (for FDA needs). They have dozens of work items that describe the product requirement, in the past they have produce the document by hand (copy and paste of work item data into word document) and it took them between 2-3 days with the hope that no mistake was done in manual process.

For the purpose of automatic documentation generation we have developed an infrastructure that can read a TFS quire “Report Product Requirement”

image

and generate a word document with full hierarchy format of the work items

image

 

The product requirement document was the simplest document that was “Automatic generated”, we have also created a SRS (software requirements specifications) and STM (software traceability matrix) which involve also the Test runs results and test cases.

image

TFS 2010 Service Pack was Released

Brian Harry announced(08/03/2011) that VS/TFS 2010 SP1 and TFS-Project Server Integration Feature Pack have Released (available for MSDN subscribers).

On Thursday 3/10, the SP1 builds will become available to non-MSDN subscribers on the Microsoft download sites.

TFS Project Server Integration Feature Pack.

One of the largest changes on TFS 2010 SP1 is to enable Visual Studio Team Foundation Server 2010 and Project Server Integration. Visual Studio Team Foundation Server 2010 and Project Server Integration Feature Pack

Integration between Project Server and Team Foundation Server is a considerable advancement for organizations that want to bridge the collaboration gap between the Project Management Office and software development teams. It enables teams to work together more effectively by:

  • Providing up to date insight into portfolio execution, alignment with strategic objectives, and resource utilization of software development projects by leveraging the quantitative data stored in different systems.
  • Automating the exchange and sharing of project information across teams and improving coordination between teams using disparate methodologies, like waterfall and agile, via common data and agreed upon metrics.
  • Enabling development and project management teams to use familiar tools to collaborate and communicate project timeline and progress such as Microsoft Visual Studio, Project, and SharePoint.

To learn more about the TFS and Project Server integration capabilities,
read Brian Harry post on the Beta release: http://blogs.msdn.com/b/bharry/archive/2010/12/07/portfolio-management-tfs-lt-gt-project-server-integration-in-beta.aspx

Improvements since the Beta include:

  • The Team Foundation Server and Project Server Integration Feature Pack is now available in every language that Visual Studio ships in.
  • Key documentation new topics and updates:
    • Updating an existing installation with Service Pack 1 RTM
    • Complete Field Mapping Reference
    • What to do you when you change your deployment (e.g. move/split a TPC, Upgrade from Project Server 2007 to Project Server 2010)
    • How to remove a component (e.g. team project, project plan, PWA) from synchronization
    • Updated Known issues and troubleshooting topic
  • A bunch of bug fixes.

TFS 2010 SP1 Bug Fixing 
You can fins a full list of bug fixing - http://support.microsoft.com/kb/2182621

Admin, Ops and Setup - New Technology Enhancements :
  • Added a tool that lets you start a service host if it is stopped
Fixed Issues:
  • Upgrade from Visual Studio 2008 fails if @@SERVERNAME is NULL
  • Update could not be installed correctly if the configuration database is being mirrored
  • Installing an update fails if one of the collections is not available
Build Automation - Fixed Issues:
  • Could not delete build drops if a controller went down
  • The first changeset in the list of "Associated Changesets" may occur two times
  • Ancient changesets being associated with build
  • Memory leaks and performance drops on TFS 2010 Build Service under heavy loads
  • A Dr. Watson error occurs on the buildnotification.exe process with an system.argumentnullexception exception
  • A Dr. Watson error on the tfsbuildservicehost.exe process with a 0xC000001D exception
  • Change the default in What to Delete, under Build Retention, from All to All - Test Result
  • Manually queuing a gated check-in build, intermittently disables the drop-down list What do you want to build
  • Build Definition Cache on the Application Tier can become corrupted when multiple definitions map or cloak the same paths in the workspace templates
  • When you undo an gated check-in, the undo does not remove unshelved adds from the disk, leaving a cluttered workspace and that can let breaking check-ins to potentially make it through
  • You can unintentionally change the build quality of a project because of odd focus and scroll wheel interaction
  • There was a performance issue with TFS 2010 Build Log Viewer
Core Services - Fixed Issues:
  • QueryActiveRequests shows requests without the associated threads
  • QueryActiveRequests occasionally stops and becomes unresponsive and never returns
  • The server plugin architecture disables plugins when an exception is thrown
  • A transport-level error has occurred when receiving results from the server
  • A Dr.Watson error occurs with a SqlException exception with the message "Failed to load Msxmlsql.dll."
  • Security service crashes when you have two paths that are different only by the letter "I" on a Turkish database
  • The Attach action fails when custom instance groups are members of collection groups
  • A Dr. Watson error on the tfsjobagent.exe process with the exception in SYSTEM.DATA.SQLCLIENT.SQL
  • Stopping the configuration service host fails if there is a running job that will take a long time to finish
  • A process that calls ApplicationServiceHost.BeginRequest may prevent the service host from stopping until the request context that was passed to that method is disposed of
  • Cannot Detach Offline Collection
Office Integration - Fixed Issues:
  • Add the Work Item ID and Title to the subject line of the email message when you export a single work item
  • Non-TFS project plan displays the error TF80070, when you change work in Task Usage view to the side by side view with a bound project plan open
  • You cannot undo a sort in Excel Trees and then clearing Sort and Filter could cause unexpected results when you try to publish a workbook
  • A disconnected client displays the error message "Server not available" for every table in a workbook
  • Error TF208021 occurs when you convert to a tree query that only contains one WI by Configure list
  • You receive an Access Violation when you instantiate CLSID {23A20EA8-2DF0-40a6-A1FA-8143EDB7B172}
  • If a filter is set on the Gantt View, a work item can be parented incorrectly when the work item is brought into the project plan through a refresh on the Team Planner view
  • Adding additional resources to a summary task does not reset all assignment units to 0%
  • Unexpected error "An item with the same key has already been added" when you try to publish a TFS work item links from MSProject
Reporting - Fixed Issues:
  • TFSOlapProcessComponent's class ICancelable implementation has to call server.Disconnect(false) in addition to CancelCommand()
  • SQL deadlocks in prc_Dimension_DimFile_AddUpdate SQL exception procedure
  • You cannot insert duplicate key row in object 'dbo.DimFile' with unique index 'DimFile_FileBK'
  • Jobs are not deleted when reporting is disabled. This results in inaccurate data that is displayed on reports
  • WIT Warehouse adapter relies on the WorkItemsAre and WorkItemsLatest tables that have the same [Changed Order] values
    Warehouse processing fails with error "The trust relationship between the primary domain and the trusted domain failed"
Team Web Access - Fixed Issues:
  • Web Access UI has not reacted to locked links
  • The View Log command cannot show content when you use a Firefox3.5 browser
  • When you build a web part, the build queries more data than is necessary. This can lead to a performance issue with lots of builds
  • Localized web access site points to ENU MSDN pages for help content
Version Control - New Technology Enhancements:
  • Adds support for QueryMergesExtended to query merge targets for a given item
  • Adds changes to baseless merge for deleted items and cherry picks
  • Adds changes to make the comparison for Get and Remap commands to be case-sensitive
Fixed Issues:
  • Branch mappings obtain the wrong mapping
  • Blocking problems on check-in and remove access control list actions
  • Product changes to remove redundant content
  • Merge and Unshelve bad query plans and the rename merge issue
  • Query plan fix for check-in, fix for infinite merge loop
  • Syncing to a label which has a duplicate name but different scope in the system, will lead to unpredictable results
  • After you open a solution, the database node in the server explorer becomes fully expanded and you are prompted to add a database diagram
  • Comparing a file after renaming its parent does not work
  • You cannot determine one branch from another branch, when they have the same name
  • A lock on a file is orphaned on check-in when the parent is renamed and checked-in in another workspace
  • You receive an InvalidOperationException exception on a message pump callback from PendingChangesFileList. This crashes Visual Studio when you try to resolve multiple conflicts
  • Autoproxy contacts LDAP every time TFS 2010 process GetOperations, when talking to a 2005/2008 server
  • Upgrade from 2005 or 2008 adds ACEs for shelvesets in addition to for workspaces. This incorrectly keep identities alive
  • Issues with the Turkish letter "I" on large check-ins
  • Candidate delete is lost when you perform a merge in a folder rename
  • When you try to merge a rename and a delete on a file, the results will lead to inconsistencies in the version control database
  • Merge does not conflict in some cases after a merge or discard in same direction
  • You receive the error "System.IO.IOException: Unable to read data from the transport connection: The connection was closed.", when you try to download a source
Work Item Tracking - Fixed Issues:
  • Backwards compatible verbatim error message were missing
  • Stack traces that contain hyperlinks that use quotation marks are truncated by the HTML server
  • Error on Work Item form in TFS when an object reference is not set to an instance of an object
  • Changing the reporting type of a field can block work item operations for up to 7 minutes
  • WorkItem.aspx treats the default description field differently than other longtext fields
  • Team project creation fails in PLOC because of a global workflow issue
  • Bypass rule attribute does not work with batch update
  • String fields should accept the new line and tab characters
  • The System.History field does not display in query results view
  • The work item OM cannot be loaded
  • Usage incorrectly identifies flags for the WitAdmin ExportGlobalWorkflow command
  • WitAdmin commands cannot be run on a release version client against an TFS SP1 server
  • The WitAdmin deletefield method causes an error "TF237159: The query contains columns that are not valid"
  • SERVERDEFAULT from currentuser does not work with fields marked as the SyncNameChanges field is set to True
  • After upgrade, allowed values in fields marked as the syncnamechanges field is set to RUE may block WIT import
  • Bypassing workflow rules is broken if you delete a field that existed before the last servicing operation
  • An index exists on the title field
  • When you use a Visual Studio 2005 or a Visual Studio 2008 client, you encounter a red X on the reporting node of team explorer
  • Did not upload process template if work item type definition references project level groups

User experience for outside us

I just read a great Post by Yaniv Golan, where he explain how living outside the US cause him often frustrated by the evident lack of awareness to the existence of any other geographic location displayed by many US-originated web & mobile companies.

In his Post Yaniv had created a check list. Implementing most of the items requires a rather trivial amount of effort, one that can easily be justified by thinking about the 95.495% of humanity that lives outside the United States of America.

Here Be Dragons. Not

How to find all the shelves in the system.

 

When you click on the Unshelve, the unshelve dialog lists all of the shelvesets created by the user listed in the Owner name field.  By default the owner name is set to the current user but replacing the name with another user name will allow finding the shelvesets created by that user

image

But what if you don’t remember the exist user name, how can you find the Shelve? 
Unfortunately there is no way to search for user names so you’ll have to know the name before opening the dialog.
The workaround for this problem is to set * as the user name, that will retrieve for you all the shelves in the system and by searching throw the details button you can find the shelve you are looking for.   

image

How to change\delete a Work Item Fields definition

I have been asked this question a few times:

  • You create a new Work item Field.
  • You define the field.
  • You discover you have a mistake in the one of the field definitions.

Now the action you will need to take depend on the “mistake” that you have made, in this post I will explain how to resolve two issues:

  1. Change\Rename the field name.
  2. “Change” the filed type.

Change\Rename a field name

Lets say that you had defined a new field definition and then you discover that you have a spelling mistake in the filed name, you wrote “Detailed Design Dascription”. 

 image

if you will try to fix the spelling mistake and save the changes you will get error TF26177.

image

So here are a few short and simple steps to rename the filed name:

  1. Open VS2010 command line.

    image
  2. in the command line type the following command:

    witadmin changefield /collection:<CollectionURL> /n:TS.DetailedDesignDescriptio
    n /name:"Detailed Design Description"

    *<CollectionURL> is your fully URL for your TFS server + collection name ex: http://tfs2010Server:8080/tfs/defaultcollection 

    When you will be asked to continue select type y 

    image

that’s all now your filed definition name as changed from whatever it was before to the new name "Detailed Design Description".

image

“Change” the filed type.

Lets say that you had defined a new field definition and then you discover that you have defined it as a String instead of HTML.

image

if you will try to fix the spelling mistake and save the changes you will get error TF26177.(Please note that you got an error on the filed name although you didn’t change it)

image
 

So here are a few short and simple steps to “Change” the filed type:

  1. First you will need to remove the filed definition from any XML file it defined in.
    To check where the filed is defined open Open VS2010 command line (see step 1 in the previous section) and type the command:
  2. witadmin listfields /collection:<CollectionURL> /n:TS.DetailedDesignDescription

    *
    <CollectionURL> is your fully URL for your TFS server + collection name ex: http://tfs2010Server:8080/tfs/defaultcollection 

    in our example you can see below that the filed TS.DetailedDesignDescription is defined only in the Team project Assaf in the work item Bug.

    image

  3. Delete the filed definition from any Work item it defined in.
    in order to delete the filed definition we will have first to export the work item
    1. In your VS 2010 open the menu Tools –> Process Editor –> Work Item Types –> Export WIT  

      image
    2. Select the Team project and the work item that you want to remove the filed from and click OK.

      image
    3. Select where to save the work item XML file.
      image
    4. Open the XML file in any XML editor (you can use notepad). delete the filed definition from the XML file and then save the file.

      Before the remove of the filed definition.
      image
    5. After the remove of the filed definition.image

    6. In your VS 2010 open the menu Tools –> Process Editor –> Work Item Types –> Import WIT  

      image
    7. In the dialog that will be opened
      • select the XML file that you had saved in step 5.
      • Select the Team Project.
      • Click OK.

        image


  4. After we have deleted the filed definition form the XML we need to delete it from warehouse.
    in the VS command and type the command:

    witadmin deletefield /collection:<CollectionURL> /n:TS.DetailedDesign

    image


  5. That’s all, now the “old” field definition was deleted you can redefined the filed with the correct type.
    image 




    * You can find more information on the witadmin command in the http://msdn.microsoft.com/en-us/library/dd236909(VS.100).aspx




New white paper from Microsoft - Upgrade from Visual SourceSafe to Team Foundation Server

Microsoft as released a white paper with a full details of why and how to migrate from VSS to the latest version of Visual Studio Team Foundation Server 2010.

  • Upgrading from Visual SourceSafe to Team Foundation Server (by Brian Harry).
    in this article you can find 
    • What are the benefits of Team Foundation Server over Visual SourceSafe?
    • How VSS and Team Foundation Server Usage Compare. (include comparison of some common VSS and Team Foundation Server Operations)
    • What happened to my favorite features? ( include some of the features available in VSS that are either not supported in Team Foundation Server or have different implementations)
    • How do I migrate from VSS to Team Foundation Server? ( include two options for moving from VSS to Team Foundation Server: Point-in-time and full
      migration. )

You can find more resource and information about TFS 2010 and migration from VSS –> TFS 2010

Custom Control and Refresh event

Recently I encounter a very odd behavior of a TFS Custom Control (CC).

A customer had asked for a new behavior in one of its custom WorkItem (WI), he had asked that every time that a WI is saved a calculation will be done on the WI and on all his child\parent.

I had wrote the CC, tested it and all seem to be OK, I had asked the customer to check the CC and his response was that the CC don’t work. I had retested the CC and it seems again OK.

I had asked the asked the customer to send me his scenario, what I discovered is that that he is doing his changes on the WI and then instead of doing save he is doing refresh and in the popup dialog that warning him about the changes he select to save.

image

After I had understood the customer scenario I had started debugging the CC to search for the problem, what I had discovered to my surprise is that the Event “FlushToDatasource()” is not called even one time during the “Refresh + Save” scenario.

While in the save scenario the order of the calls is:

1. FlushToDatasource

2. InvalidateDatasource

3. InvalidateDatasource

In the “Refresh + Save” scenario the event InvalidateDatasource is called 5 times in a row and the event FlushToDatasource is not called even once.

Now I will have to move all the logic of the CC to the FlushToDatasource event, which changes the “roles” of the game since for example the wItem.IsDirty is no longer true in the FlushToDatasource event even if the WI was change.