TFS & Visual Studio ALM - by Neno Loje

(formerly Team System, VSTS)

News

Recent Posts

Community

Tags

Email Notifications

VSTS Blogs

VSTS Community

My Other Blogs

German VSTS Websites

Archives

Export TFS Work Items to an .XML file (using TFS Power Tools)

TFS Work Items can be easily exported to XMLSteps:

  1. Download Team Foundation Server Power Tools.

  2. On the command line use the TFPT.exe utility to export all work items from a team project in .XML format:

    tfpt query /collection:<URL> /format:xml /wiql:"SELECT * FROM WorkItems WHERE [System.TeamProject] = '<TeamProject>' AND [System.WorkItemType] <> 'Sprint' ORDER BY [System.Id]" > WorkItems.xml

    As you can see I selected all work items from the team project excluding Sprint Work Items. Feel free to modify the query, if necessary.

Download: Visual Studio 2010 Project Template for TFS Utilities

If you develop small utilities for Team Foundation Server a lot, you might want to save some time and use a project template (see bottom of post for download link) that already comes equipped with the correct references to the Team Foundation Object Model (Microsoft.TeamFoundation.*.dlls) as well as the most important using statements and a few lines of code to get started.

Installation

Copy the ZIP file to {MyDocuments}\Visual Studio 2010\Templates\ProjectTemplates.

Usage

Create a new project and select “TFS Utility” from the “Visual C#” list.

TFS Utility Project Template 

The template creates a new Windows Forms application with references to the Microsoft.TeamFoundation.*.dlls (btw: the C# compiler gets rid of all references that were not used in the project during compilation)…

 References to Team Foundation Object Model

… as well as a a few using statements and some code to start from.

Generated code in Form1.cs 

Happy TFS tool development!

Download: TfsUtility.zip

Publishing Requirements from Word to TFS (via WordToTFS)

This post is part of a blog series:

Steps:

  1. Download and install the freeware tool AIT WordToTFS from here (registration required).

    WordToTFS - ClickOnce installation 

  2. Start Microsoft Word (winword.exe). You should see a new "WordToTFS" ribbon.

    WordToTFS - Ribbon

  3. Choose the layout template you want to use (the names correspond to TFS process templates, but it's possible to furhter customize those layout templates).

    WordToTFS - Choosing the layout template

  4. Once, you are ready to publish, click 'Connect' on the 'WordToTFS' ribbon and choose a team project to connect to.

    WordToTFS - Connect to TFS

  5. Start by creating an outline, headlines, introduction text as you would normally do when creating a requirements document in MS Word.

  6. Once you are ready to add a requirement, choose "Empty Product Backlog Item" (in the case of the "Visual Scrum Scrum" template; the name differs for other process template, e.g. "Requirement" in MSF/CMMI or "User Story" for MSF/Agile).

    WordToTFS - Creating a new requirement in the word document

  7. This will insert a table with the typical fields to describe a requirement. Replace 'Title' and 'Description' with appropriate values (you can edit those defaults by clicking "Edit Default Values" on the ribbon).

    WordToTFS - Requirement according to the selected layout template

  8. Repeat Steps 5 to 7 for additional requirements.

  9. Once you're happy with your requirement(s), click 'Publish' in the 'WordToTFS' ribbon.

    WordToTFS - Publish 

    WordToTFS - Saving work items in TFS


    WordToTFS - Publishing results
  10. The work item is now created in TFS.
    After publishing the requirement table looks smilar to this:

    WordToTFS - Default work item layout in MS Word 

Notes:

  • Keep in sync: After initially publishing your work items you can either change those in MS Word and re-publish those changes, or change the work items with a different TFS client and click 'Refresh' on the 'WordToTFS' ribbon to import those changes into your MS Word document.

    WordToTFS - Keeping your document in sync using Refresh 

  • Images: You can insert images in the description field (if the process template is using an HTML-based field) and those will be updated as attachments:

    SupportForImages
  • Test Cases with Test steps: You can enter a numbered list of steps for a Test Case, which will be translated to test steps (as they are required by Microsoft Test Manager):

    SupportTestCases01

    SupportTestCases02

Disclaimer: This MS Word integration is not part of Visual Studio or Team Foundation Server. The plug-in was developed by a Microsoft Partner (AIT) and not by Microsoft itself.

Exporting TFS Work Items to Microsoft Word (via WordToTFS)

This post is part of a blog series:

Steps:

  1. Download and install the freeware tool AIT WordToTFS from here (registration required).


    WordToTFS - ClickOnce installation

  2. Start Microsoft Word (winword.exe). You should see a new "WordToTFS" ribbon.


    WordToTFS - Ribbon 

  3. Choose the layout template you want to use (the names correspond to TFS process templates, but it's possible to furhter customize those layout templates).


    image_thumb4 

  4. Click 'Connect' on the 'WordToTFS' ribbon and choose a team project to connect to.


    WordToTFS - Connect to TFS 

    If the "missing mapping fields" dialog appears, you probably choose the wrong layout template (you can still change it before the next steps). 

  5. Click 'Get Work Items" from the ribbon.

  6. On the 'Get Work Items' pane to the ride, select a stored query.

    WordToTFS - Get Work Items

  7. Click on 'Find' button.
    Optionally, deselect work items in the list if you want to exclude them.

  8. Click on 'Import' button.


    WordToTFS - Importing Work Items


    WordToTFS - Work Items in an MS Word document
  9. Enjoy!

 

Disclaimer: This MS Word integration is not part of Visual Studio or Team Foundation Server. The plug-in was developed by a Microsoft Partner (AIT) and not by Microsoft itself.

Error Code 1603 when trying to install TFS 2010 SP 1

TFS 2010 SP1 Setup fails when the installing user has not enough SQL database permissionsIssue:
TFS 2010 SP 1 fails with:

Product: Microsoft Team Foundation Server 2010 - ENU - Update 'KB2182621' could not be installed. Error code 1603.

Resolution:
In my case the log file indicated that permissions to the Master database were missing. I made sure the setup user got sysadmin priviledges for the time of the SP install and it went through very smoothly.

Book Recommendations for Team Foundation Server 2010

(An updated list for TFS 2012 is available here)

This is my personal selection of books covering TFS 2010:

ShowCover_small7 Agile Software Engineering with Visual Studio: From Concept to Continuous Feedback [Sample Chapter]

The book that Sam Guckenheimer (the Product Owner of Visual Studio) and I wrote about how agile software development with agile practices and Scrum as a project management framework can work with the support of VS.
Professional20Team20Foundation20Serv Professional Team Foundation Server 2010

Many useful tips and best practices from experts regarding all parts of TFS 2010.
Recommendation: should not be missing on any desk.
ShowCover6 Software Testing with Visual Studio 2010
Targets specifically testing with VS 2010 and Microsoft Test Manager (MTM).

(Note: There's a second book with a very similar title.)
Unbenannt1 Inside the Microsoft Build Engine: Using MSBuild and Team Foundation Build (2nd edition)

Specifically about the topic of automated builds
(Note: Only the last half is TFS-related.)
vs2010alm_book_32 Professional Application Lifecycle Management with Visual Studio 2010: with Team Foundation Server 2010 [Sample Chapter]

For getting started: a solid overview over all ALM-related functionality in Visual Studio & TFS 2010.
mzi_rahzirdp_225x225-754 Professional Scrum with Team Foundation Server 2010

A book dedicated to how to do Scrum with TFS 2010.
(Note: I recommend chapters 3, 5 and 11.)

Have fun reading!

ALM Summit 2011 – Taking agile to the next LEVEL

alm_summit

Application Lifecycle Management for the Microsoft Platform
November 14th–18th, 2011 • Microsoft, Redmond Campus

image

Agenda & Registration at : http://www.alm-summit.com

Update: the session recordings can be found on Channel 9: http://channel9.msdn.com/Events/ALM-Summit/2011

Book: Agile Software Engineering with Visual Studio

(Link: Updated 3rd edition for TFS 2012)

ISBN-10: 0321685857Finally the book that Sam and I wrote on agile software engineering with Visual Studio 2010 is now available.

I want to say thank you to our technical reviewers (David Starr, Claude Remillard, Aaron Bjork, David Chappell, and Adam Cogan), as well as to Ken Schwaber for providing the foreword.

Where to get it:

ISBN-10: 0321685857

Available in: English, Japanese

Paperback Amazon | InformIT
DRM-free PDF InformIT
Amazon Kindle Amazon

Promotional Code

Our publisher, Addison-Wesley Professional, has put together a promo code that will allow you to order either the printed copy or the DRM-free PDF copy of the book for 35% off. Here are the details for that promo code: To purchase, go to InformIT.com and during step 3 of the checkout process, enter ASEVS5858 as the coupon code. This discount does not apply to the already discounted eBook/Print bundle. Offer valid until December 31st, 2011.

Sample Chapter

Table of Contents

Authors

  • Sam Guckenheimer is the product owner for the Microsoft Visual Studio product line.
  • Neno Loje is an independent Application Lifecycle Management (ALM) consultant and Visual Studio Team Foundation Server (TFS) specialist.

Book Description

Using agile methods and the tools of Visual Studio 2010, development teams can deliver higher-value software faster, systematically eliminate waste, and increase transparency throughout the entire development lifecycle. Now, Microsoft Visual Studio product owner Sam Guckenheimer and leading Visual Studio implementation consultant Neno Loje show how to make the most of Microsoft’s new Visual Studio 2010 Application Lifecycle Management (ALM) tools in your environment.

This book is the definitive guide to the application of agile development with Scrum and modern software engineering practices using Visual Studio 2010. You’ll learn how to use Visual Studio 2010 to empower and engage multidisciplinary, self-managing teams and provide the transparency they need to maximize productivity. Along the way, Guckenheimer and Loje help you overcome every major impediment that leads to stakeholder dissatisfaction–from mismatched schedules to poor quality, blocked builds to irreproducible bugs, and technology “silos” to geographic “silos.”

Coverage includes:

  • Accelerating the “flow of value” to customers in any software project, no matter how large or complex
  • Empowering high-performance software teams and removing overhead in software delivery
  • Automating “burndowns” and using dashboards to gain a real-time, multidimensional view of quality and progress
  • Using Visual Studio 2010 to reduce or eliminate “no repro” bugs
  • Automating deployment and virtualizing test labs to make continuous builds deployable
  • Using Test Impact Analysis to quickly choose the right tests based on recent code changes
  • Working effectively with sources, branches, and backlogs across distributed teams
  • Sharing code, build automation, test, project and other data across .NET and Java teams
  • Uncovering hidden architectural patterns in legacy software, so you can refactor changes more confidently
  • Scaling Scrum to large, distributed organizations

Whatever your discipline, this book will help you use Visual Studio 2010 to focus on what really matters: building software that delivers exceptional value sooner and keeps customers happy far into the future.

Previous Editions
Restrict TFS to only allow connections from clients with VS SP1

You can control which clients get rejected when trying to connect to your TFS.

Scenario

You are running TFS 2010 SP1 and want to make sure that all clients have (VS) SP1 (at minimum) applied.

Luckily, you can configure which clients get rejected when trying to connect to your TFS. You can even provide the message that will be displayed to users whose clients get rejected:

image BlockNonSP1Clients_Sorry1

Solution

It's easy, you have to add two values to the TFS registry (and restart TFS):

  • Key: /Configuration/Application/DisabledUserAgents/TFS10SP1
    Value: "Team Foundation (*.exe, 10.0.<40219.1)"
  • Key: /Configuration/Application/DisabledUserAgents/TFS10SP1/Message
    Value: "Sorry, you have to install Visual Studio 2010 Service Pack 1."

How to do that

Use the tfsreg.exe tool and run this two commands:

tfsreg.exe /server:http://servername:8080/tfs /path:/Configuration/Application/DisabledUserAgents/TFS10SP1 /value:"Team Foundation (*.exe, 10.0.<40219.1)"
tfsreg.exe /server:http://servername:8080/tfs /path:/Configuration/Application/DisabledUserAgents/TFS10SP1/Message /value:"Sorry, you have to install Visual Studio 2010 Service Pack 1."

Note: Replace the blue URI with your TFS' server URI.

Or download the ready-to-use BlockNonSP1Clients.bat (.ZIP)

Caution: Always remember do not directly edit the TFS registry entries by editing TFS' SQL databases manually. Always use the registry service (client or server) or the tfsreg.exe tool mentioned above (which does that) to modify TFS registry entries.

Future Compatibility Note: This mechanism might change or be implemented differently in future versions of TFS, there's no compatibility guarantee.

Update (2 Oct 2011): In TFS 2010 older clients (VS 2005 and VS 2008) that do not have Service Pack 1 and the appropriate Forward Compatibility Upgrade installed, will be rejected by default using this technique.

(Thanks to Philip Kelley, Taylor Lafrinere, and Buck Hodges from Microsoft for this tip).

Solved: How to find shelvesets from all team members?

If you don't know the owner name, is there another way to search for the shelveset?

In the "Unshelve" dialog, either enter the username, or use "*" (for all users):

SNAGHTML72414ec

(Thanks to VS ALM MVP-colleague Mike Fourie for raising the question.)

VS 2010 Extension Manager: How to turn off update checks
Option 1: Manually in Visual Studio 2010 using Tools » Options:

VS Ext Mmgr

Option 2: Using a registry key

RegEdit

Download .REG file: DisableAutoCheckForUpdates.reg (.ZIP)

(Thanks to Robert MacLean for this tip and both screenshots.)

Posted: Tue, Sep 6 2011 11:16 by neno | with no comments
Filed under:
Installing TFS Build 2010 on a non-domain-joined machine

Scenario

You want to install and run TFS Build Controller and Agent on a separate network/domain than your Team Foundation Server 2010.

Disclaimer:
According to Ruiz from the MSDN Subscriber Support in Forum this is not officially supported.

How to solve:

  1. Install Team Foundation Build 2010 from TFS media.
     
  2. Apply latest updates (e.g. Service Pack 1, Cumulative Update 1).
     
  3. Create user account (both locally on the Build server as well as your TFS AT) as the service account for Team Build (e.g. TFSBUILD)
     
  4. On TFS, add service account TFSBUILD to Project Collection Build Service Accounts security group (on the collection-level)
     
    TFSBuildWithoutDomain0
     
  5. Configure the Build Server: when asked leave the "team project collection" field blank.
       
    TFSBuildWithoutDomain1
     
  6. Choose any system account for now.
     
    TFSBuildWithoutDomain2
     
  7. After configuration has completed, open the Build Service properties and set the service account to your local account (e.g. ".\TFSBUILD")
     
  8. Done. You can now start the Build Service, define a Build Controller and Build Agents.
     

More Information:

(Thanks to Wes MacDonald and Etienne Tremblay to guide me through this.)

Additional note from Wes:
The other thing I should mention is we had to have the build agent hostname defined in the HOSTS file on the TFS Application Tier and the TFS Server hostname defined in the Build Agent HOSTS file. This assumes the DNS is not configured with the entries.

Visual Studio 2010 SP1 Installation Error: Generic Trust Failure

General Trust Failure. How we love those descriptive error messages.Problem description:
Visual Studio (VS) Service Pack (SP) 1 fails with an
"Generic Trust Failure".

Cause:
Probably the .ISO file is corrupt.

How to fix:
You can try to re-download the .ISO file or use the VS SP1 Web Installer (which downloads only the required patches itself) and re-apply the patch, when asked to chose between re-apply and uninstall.

More Information:
The .ISO file has the following checksums (according to Heath Stewart's blog post):

  • SHA1: 61C2088850185EDE8E18001D1EF3E6D12DAA5692
  • CRC: C77C2A14

Updated (Sept 3rd, 2011) to include link to checksum of .ISO file. (Thanks to Ahmed Ilyas)

How to restart TFS using the command line

The TFS logic is running as an application pool in IIS.To recycle the TFS app pool, just run:

%windir%\system32\inetsrv\appcmd recycle apppool /apppool.name:"Microsoft Team Foundation Server Application Pool"

Note: Requires admin priviledges (run as admin).

This will also pick up new settings from the TFS registry.

(Source: Grant Holliday and MSDN Library.)

VS 2010: How to find out if VS SP1 is installed?

Question: How can I easily see if VS SP1 is installed on my machine?

Answer: Run VS 2010, open Help » About. Look for "SP1Rel" after the version number.

Screenshot:

Figure: This is how it should look like with installed VS SP1.

Posted: Mon, Jul 11 2011 11:08 by neno | with 1 comment(s)
Filed under:
Available Check-In-Policies for Team Foundation Server 2010

Note: This list will not be updated anymore. For TFS 2012, refer to the updated list.

Check-In Policies

Shipping as part of Team Foundation Server 2010:

  • Builds – Requires that build breaks that were created during a build must be fixed before a new check-in.
  • Code Analysis – Requires that code analysis is run before check-in. [More]
  • Testing Policy – Requires that check-in tests are completed before check-in.
  • Work Items – Requires that one or more work items be associated with the check- in.

Supplied by the TFS 2010 Power Tools (needs to be installed on all VS clients):

  • Changeset Comments Policy – Requires users to provide check-in comments.
  • Custom Path Policy – Allows you to scope other check-in policies to specific folders or file types.
  • Forbidden Patterns Policy – Prevents users from checking in files with filenames that contain forbidden characters or patterns.
  • Work Item Query Policy – Requires that the associated work items need to be part of the result of a specified work item query.
Note: When using an older version of VS (2005/2008) you need to install the corresponding version of the TFS Power Tools (VS 2005 requires 2005 Power Tools, etc.)
Developed by the Community:
But what about the "Override policy" checkbox?

There might always be an unforeseen reason why not all policies could be fulfilled.

Further reading:

Do you know another great check-in policy for TFS 2010? Let me know!

Updates:

How to change update frequency of the TFS warehouse/cube

By default TFS 2010 updates its warehouse every 2 hours.

You can change the frequency by running the WarehouseControlService SOAP webservice, as explained in this article.

Furthermore the webservice exploses some more settings as well.

To force the warehouse to update immediately, you can use the TfsRefreshWarehouse tool.

To make it easier to change the default frequency, you can use this command line tool:

Syntax/Usage:

To shorten the interval down to 1 hour (= 3600 seconds):

TfsWarehouseController.exe /server:http://localhost:8080/tfs
/name:IncrementalProcessIntervalSeconds /value:3600

Please be aware of this warning, taken out streigt from MSDN:

Important

If you reduce the interval to less than the default of two hours (7200 seconds), processing of the data warehouse will consume server resources more frequently. Depending on the volume of data that your deployment has to process, you may want to reduce the interval to one hour (3600 seconds) or increase it to more than two hours.

There's also a /list parameter that shows all current settings (without making any changes):

White text on black background makes me happy...

Download the tool from here: TfsWarehouseController.exe (.ZIP, 12,00 KB)

Prerequisite: This tool requires Team Explorer 2010 to be installed.

Required Permissions: Administer Warehouse (TFS server-level permission)

Creating Fake builds in TFS Build 2010 using the command line

In TFS it's possible to create "faked" builds, without actually running them. You can read about it in this blog post by Jason Prickett.

Main scenarios are:

  • Using a different build tool than TFS Build
    (by creating faked builds will let you use some of the great TFS features).
  • Creating sample data to show off TFS functionality

You can create "faked" builds on the command line using the following tool.

Syntax/Usage:

TfsCreateBuild.exe /collection:http://tfsserver:8080/tfs/MyCollection
/project:TeamProject /builddefinition:"Daily Build"
/buildnumber:"MyApplication_Daily_1.0"

(replace parts in blue)

Optional parameters:

  • /status:<value> Status of the build (Succeeded, Failed, Stopped, PartiallySucceeded)
  • /flavor:<name> Flavor of the build (to track test results against, default: Debug)
  • /platform:<name> Platform of the build (to track test results against, default: x86)
  • /target:<name> Target of the build (shown on build report, default: default)
  • /localpath:<path> Local path of solution file. (e.g. Solution.sln)
  • /serverpath:<path> Version Control path for solution file. (e.g. $/proj/src/app.sln)
  • /compileerrors:# Number of compilation errors.
  • /compilewarnings:# Number of compilation warnings.
  • /analysiserrors:# Number of static code analysis errors.
  • /analysiswarnings:# Number of static code analysis warnings.
  • /droplocation:<path> Location where builds are dropped.
  • /buildlog:<path> Location of build log file. (e.g. \server\folder\build.log)

The result:

No, TFS cannot compile Win 3.1 apps...

Download the tool from here: TfsCreateBuild.exe (.ZIP, 5,94 KB)

Prerequisite: This tool requires Team Explorer 2010 to be installed.

Configuring Urban Turtle for customized process templates

Urban Turtle is a planning and task board extension to Team Web AccessYou are using Urban Turtle, and when opening the Planning Board or Task Board tab you receive the following error message:

Error Message: Errors in the configuration file currently prevent Urban Turtle from properly displaying some data (see more details).

Urban Turtle needs to be configured to support custom processes.

Cause:

Urban Turtle supports the following process templates out-of-the-box:

  • MSF for Agile Software Development (English and French version)
  • Visual Studio Scrum 1.0 (English)
  • Scrum for Team System v3

For other/customized process templates/work item types, you need to supply a config file.

Workaround:

  • Locate the folder {ProgramFiles}\Microsoft Team Foundation Server 2010\Application Tier\Web Access\Web\UrbanTurtle\configuration\project'
  • Copy the .XML file of an existing process that fits most
    (do not modify the original .XML files as those are removed during uninstall/upgrade)
  • Change the copy of the .XML file to the values from your process template
  • Enjoy Urban Turtle!

Note: If you are using "MSF for CMMI Process Improvement" you can contact Urban Turtle support and they will send you a compatible configuration file to drop in the config folder.

(Thanks to Mario Cardinal and the UrbanTurtle team for this support with this.)

Installing SharePoint 2010 complete install using local accounts

The Scenario

You want to install SharePoint 2010 complete install and use local accounts (instead of Active Directory accounts).

The Problem

You receive the following error message:

The specified user is a local account. Local accounts should only be used in stand alone mode.
Error Message: The specified user is a local account. Local accounts should only be used in stand alone mode.

The Solution

The workaround is to use a PowerShell script instead of the Wizard, as explained at: http://sharepoint.microsoft.com/blogs/fromthefield/Lists/Posts/Post.aspx?ID=112

More Posts « Previous page - Next page »