But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

More from the ALM Rangers - Lab Management Guide

The Build Customisation project was not the only ALM Rangers release over the weekend. The Lab Management Guide was also shipped. This provides scenario based and hands-on guidance for the planning, setup, configuration and usage of Visual Studio Lab Management, backed by custom VM Template automation for reference environments.

If you work with Lab Management, or would like, this is well worth a read

 

 

 

 

ALM Ranger’s Build Customization Guidance has shipped

I am really please to say that the first ALM Rangers project I have been involved with, the Build Customization Guidance, has shipped.

The project had the primary goal of delivering scenario based and hands-on lab guidance for the customization and deployment of Team Foundation Build 2010 activities such as versioning, code signing, and branching. You can find details at the Rangers blog,the project table of content or the codeplex site

I have certainly learnt a good deal working on this projects, thanks to everyone who made it such a interesting experience. Hope anyone reading the materials find them as useful.

 

 

 

 

 

Using VSTO to access TFS

Have you ever thought ‘I know that you get the Team ribbon in Excel to manage TFS work items, and I can use Excel to as a SQL/OLAP client to run reports from the TFS warehouse but I want to do more….’?

Have you every considered using VSTO to create an ActionPane that uses the TFS .NET API?

image

In this example I have created an ActionPane that allows you to select a Team Project Collection, a Team Project and then a build definition. Press the button and it lists the builds that have run of this type using the TFS .NET API.

The code can be downloaded here, it is fairly basic, could be more exception handling for connection failures, but shows the principle.

Cannot connect to a Lab Management Environment using the MTM Environment Viewer

Today we had a problem that we could not connect to VMs within a Lab Management environment from the Environment Viewer in MTM. We had composed the environment from VMs independently create and tested on the HyperV host. The plan in the end is to have this as a network isolated environment, but for now it is a private domain that exists on our main LAN.

The first issue we had was that as this was a private domain the various hosts were not registered on our DNS, so we got a DNS lookup error for the VM host names. This is best fixed with network isolation, but for a quick fix we put some entries in a local hosts file on the PC we were using to resolve the name to IP addresses.

The next problem was one of concepts. The environment had been composed by one user (and could access everything via a host connection via Hyper-V, with no local host file fixes), but it was to be used by another user, a tester who was not the owner of the environment (yes again I know we should they should be provisioning their own network isolated version). This mean that a Hyper-V based host connection was not possible, as you have to be the owner to get a host connection.

This meant that the new user had to use a guest connection, a Remote Desktop Connection (RDC) created behind the scenes by the MTM Environment Viewer. This worked for the domain controller (a server OS) but failed for the other three VMs in the environment which were all running Windows 7 with a ‘lost connection to virtual machine error’

image

Turns out the issue was the level of security set for RDC connection in Windows 7. We remoted onto the VMs with the problems using the standard Windows RDC client (not MTM) and set the Allows connections from computers running any version of RD.

image

Once this was done the Environment Viewer could make guest connections and all was good in the world.

Recording Silverlight actions on Microsoft Test Manager

Whilst try to record some manual tests in MTM for a new Silverlight application I found I was not getting any actions recorded, just loads of “Fail to record the object corresponding to this action” warnings in the actions window.

Turns out to fix this you have to do three things

  1. Install the Visual Studio 2010 Feature Pack 2 (MSDN Subscribers Only) – this adds Silverlight support to MTM (this I had already done)
  2. In your SIlverlLight application you need to reference the Microsoft.VisualStudio.TestTools.UITest.Extension.SilverlightUIAutomationHelper.dll  from the folder C:\Program Files (x86)\Common Files\microsoft shared\VSTT\10.0\UITestExtensionPackages\SilverlightUIAutomationHelper
  3. Finally if using IE9 you need to run IE in IE8 mode. To do this in IE9 press F12 and select the browser mode

image

Once this was done I got the actions I would expect

image

Cross domain usage of TFS Integration Platform

Whist trying to do a cross domain migration of some source between two TFS2010 servers, I got the less than helpful runtime exception

System.ArgumentNullException: Value cannot be null.
Parameter name: activeWorkspace
at Microsoft.TeamFoundation.Migration.Tfs2010VCAdapter.TfsUtil.CleanWorkspace(Workspace activeWorkspace)
at Microsoft.TeamFoundation.Migration.Tfs2010VCAdapter.TfsVCMigrationProvider.ProcessChangeGroup(ChangeGroup group)

On checking the _tfsintegrationservice_<timestamp>.log I found the more useful

TFS::Authenticate : Caught exception : Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: You are not authorized to access tfsserver.otherdomain.com. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.

The issue is that when you setup the migration you are prompted for credentials for the remote server, but the actual migration does no occur in the same thread as you setup the definitions, so it only has its local credentials and none for the remote system. Hence the 401 error.

There is no way to enter two sets of credentials within the Integration tool itself, but there is a workaround on Willy’s Cave. This is to place the remote credentials in the PC’s credential manager, this work fine for me