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

Solved: Visual Studio Team Explorer 2010 crashes with MissingMethodException

Re-applying Visual Studio 2010 Service Pack 1 solved the issue.

How to set the SMTP Port in TFS 2010

The Problem

  • You are configuring SMTP Settings for TFS 2010 and want to specify a different port for your SMTP server than the default port (which would be port 25)

    How to specify a custom SMTP port for TFS 2010?
    Figure: TFS 2010 does not allow to set a custom SMTP port.

Solution #1: Change config file

  • As answered here and here, you could add the following XML to the TfsJobAgent.exe.config file (usually located in C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\TFSJobAgent):

<mailSettings>
  <smtp deliveryMethod="Network">
    <network port="2525"/>
  </smtp>
</mailSettings>

  • Keep in mind that this is only valid for TFS notifications itself and not for notifcations from SQL Server Reporting Services or the SharePoint-based Project Portal.

The Solution #2: Install a local SMTP server

  1. Install the SMTP Service on Windows Server and ask it to route all SMTP traffic to a different SMTP server.
  2. On the Delivery tab, click Advanced, an enter the SMTP server name as "smart host".
  3. On the Delivery tab, click Outbound Connections, and set the TCP port (= SMTP port).

Set your external SMTP server as smart host.Set TCP port to the SMTP port you want to use.
Figure: Setting up a local SMTP server has the great benefit that you can use it SMTP for other applications, too (like notifications from SQL Server Reporting Services or SharePoint).

How to move a SQL Server Database from Enterprise to Standard Edition

Cross-posted from my other blog:

Microsoft_SQL_Server_Logo_thumb[1]

The Problem

  • You have a database (e.g. TFS collection database) in SQL Server Enterprise Edition.
  • You want to backup and restore this database on a SQL Server Standard Edition.
  • You get an error message on restore that some features are not supported.

The Solution

[Read the full post]

TFS Build cannot resolve dependency to assembly 'Microsoft.Windows.Design.Extensibility'

The Problem

  • You are using DevExpress components.
  • Compilation fails with the message:

'Cannot resolve dependency to assembly 'Microsoft.Windows.Design.Extensibility, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

The Solution

  • Check your references and remove any reference to DevExpress.*.Design.dll's.

(Thanks to "Kookiz" who solved this.)

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

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 Visual Studio.
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 solut 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

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

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

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

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:

More Posts Next page »