But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

More tips and tricks using my Typemock custom build activity with TFS 2010 build

Every time I add the Typemock Isolator custom activity to a TFS 2010 build I learn something new that eases the process. In the past I have posted on the basic process to get the activity into your build, and I would also draw your attention to the ALM rangers guide to build customisation, which provides loads of useful information on this front.

Today, when I added the activity to a build I made the following improvements to the settings to make life a bit easier. This build is one used wildcard scanning for assemblies containing test with a test configuration file (this is the red usage in the documentation, it will make sense if you read the documentation)

image

So the changes over and above the usually configuration.

  1. In the project used to edit the build process workflow I added a reference to the Microsoft.TeamFoundation.Client assembly (found in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0\Microsoft.TeamFoundation.Client.dll)
  2. This meant I could replace the hard coded TPC Url property ProjectCollection on the ExternalTestRunner activity with BuildDetail.BuildServer.TeamProjectCollection.Uri.ToString()
  3. I noticed you have to explicitly set the build definition’s configuration and platform. If you only set the target solution and let these default the test results are not published. This I suppose is a bug in the activity, but not one I am rushing to look at as I would normally set these values

So for my usage of the custom activity the properties are

image

As you can see these are nicely generic now, no project based hardcoded values

More on running multiple TFS build controllers on a single VM

I have been having a on-going project to run multiple build controllers on a single VM. Today I needed to reconfigure a on of the controllers to point at a different TPC. You have to do this the correct way to avoid problems.

My error log was full of

Http communication failure:
Exception Message: Cannot listen on pipe name 'net.pipe://build/ServiceHost/1' because another pipe endpoint is already listening on that name. (type AddressAlreadyInUseException)

It all boiled down to the fact I ended up with two controllers trying to use the same URI, in my case

vstfs:///Build/ServiceHost/1

The number at the end of this URI is assigned when the controller is registered with a TPC. If, as I did, you just stop a controller and edit its properties to point at another TPC and restart it, it is possible to end up with two controllers on the same box trying to use the same ID.

The simple fix is to unregister the build controller and the register it with the new TPC as needed. This will cause the machine to be scanned and new, empty ID chosen for the URI. As as detailed in Jim Lamb’s original post.

As a side effect I also saw errors in the log saying custom activity assemblies could not be loaded due to permission errors. This all turned out to be that the custom activities are stored in

C:\Users\[tfs build account]\AppData\Local\Temp\BuildAgent\[agent ID] 

So if two agents have on the ID, even if one’s parent controller is failing to load fully, it will tend to lock the files for the other controller. Again this was fixed by registering the controller and agents in the correct manner

Solution to ‘Missing requirement: Shared profile 1.0.0.1308118925849’ error when installation TEE SP1 on Eclipse Indigo

[Updated 1 mar 2012 - This should only effect you if Eclipse is unzipped into your 'c:\program files' folder structure)

During my new laptop build I have had to reinstall Eclipse, so I took the chance to upgrade to the Indigo release. When I tried to install the TFS 2010 Team Explorer Everywhere SP1 plug-in I got the error

Cannot complete the install because one or more required items could not be found.
  Software currently installed: Shared profile 1.0.0.1308118925849 (SharedProfile_epp.package.java 1.0.0.1308118925849)
  Missing requirement: Shared profile 1.0.0.1308118925849 (SharedProfile_epp.package.java 1.0.0.1308118925849) requires 'org.maven.ide.eclipse [1.0.0.20110607-2117]' but it could not be found

This stumped me for a while, but after a bit of searching on Eclipse forums I found this was a problem common to installing other plug-ins, not just TEE, so not a TEE dependency as the error suggests.

The issue was you have to be running Eclipse as an administrator to install the plug-in. Judging from the forums this has tripped a few people up with plug-ins on the Indigo release, seems this was not the case with the previous releases such as Helios.

Once you have installed the plug-in as administrator you can restart Eclipse in standard mode and connect to your TFS server as you would expect.

Workaround to connect to a TFS Lab Environment from outside a TMG firewall

Whist on the road I have had need to access our Lab Management system via our TMG firewall through which we expose our TFS 2010 for remote users (via SSL). When I load Microsoft Tests Manager (MTM) I can connect to the TFS server, as expected, and go into ‘Lab Center’ mode. I can see my project’s environment and can start, stop and deploy them without issue (all communication routed via our TFS server). However the MTM environment viewer fails to make a connection to the test VMs in the environments.

image

MTM environment viewer can connect to an environment in two ways:

  • Host connection – via the Hyper-V management protocols
  • Guest connection – via a RDP session to the VM’s operating system

From outside our firewall a host connection is not an option as the required ports are not open. So my only option was a guest connection. However, our TMG firewall is set to provide a  RD gateway, effectively a proxy for RDP sessions. You have to configure RDP to use this, and have to authenticate with this gateway prior to authenticating with the actual target remote machine.

image

The problem is MTM does not support the use of TMG RD Gateways.

However there is a solution. If I right click on the VM in MTM Environment Viewer you can launch a standard remote desktop session.

image

If you do this you will be prompted to authenticate correctly.Firstly with your domain account to authenticate with the TMG RD gateway, then for other credentials to the test VM.

So a reasonable workaround, if a VPN or TMG Direct Access is not on option for you.

TF30162: Task "BuildTask" from Group "Build" failed – when creating a team project

When trying to create a new Team Project on my test TFS 2010 basic installation I got the error

Time: 2011-07-05T11:43:36
Module: Engine
Event Description: TF30162: Task "BuildTask" from Group "Build" failed
Exception Type: Microsoft.TeamFoundation.Client.PcwException
Exception Message: Multiple identities found matching workspace name 'TYPHOONfbb296e15246421e9fc8d25e9d128512typhoon (VC)' and owner name 'BLACKMARBLE\fez'. Please specify one of the following workspace specs:
TYPHOONfbb296e15246421e9fc8d25e9d128512typhoon (VC);BLACKMARBLE\fez
TYPHOONfbb296e15246421e9fc8d25e9d128512typhoon (VC);BLACKMARBLE\fez
Stack Trace:
   at Microsoft.VisualStudio.TeamFoundation.Build.ProjectComponentCreator.ExecuteInternal(ProjectCreationContext context, XmlNode taskXml, Boolean validationOnly)
   at Microsoft.VisualStudio.TeamFoundation.Build.ProjectComponentCreator.Execute(ProjectCreationContext context, XmlNode taskXml)
   at Microsoft.VisualStudio.TeamFoundation.ProjectCreationEngine.TaskExecutor.PerformTask(IProjectComponentCreator componentCreator, ProjectCreationContext context, XmlNode taskXml)
   at Microsoft.VisualStudio.TeamFoundation.ProjectCreationEngine.RunTask(Object taskObj)
--   Inner Exception   --
Exception Message: Multiple identities found matching workspace name 'TYPHOONfbb296e15246421e9fc8d25e9d128512typhoon (VC)' and owner name 'BLACKMARBLE\fez'. Please specify one of the following workspace specs:
TYPHOONfbb296e15246421e9fc8d25e9d128512typhoon (VC);BLACKMARBLE\fez
TYPHOONfbb296e15246421e9fc8d25e9d128512typhoon (VC);BLACKMARBLE\fez (type MultipleWorkspacesFoundException)

Exception Stack Trace:    at Microsoft.TeamFoundation.VersionControl.Client.InternalCache.GetWorkspace(Guid repositoryGuid, String name, String owner)
   at Microsoft.TeamFoundation.VersionControl.Client.InternalCache.Merge(XmlNode xmlOnDisk, InternalWorkspaceConflictInfo[]& removedConflictingWorkspaces)
   at Microsoft.TeamFoundation.VersionControl.Client.InternalCache.Save(XmlNode inputXml, XmlNode outputXml, InternalWorkspaceConflictInfo[]& removedConflictingWorkspaces)
   at Microsoft.TeamFoundation.VersionControl.Client.InternalCacheLoader.SaveConfigIfDirty(InternalCache internalCache, InternalWorkspaceConflictInfo[]& conflictingWorkspaces)
   at Microsoft.TeamFoundation.VersionControl.Client.Workstation.UpdateWorkspaceInfoCache(String key, VersionControlServer sourceControl, String ownerName)
   at Microsoft.TeamFoundation.VersionControl.Client.Workstation.EnsureUpdateWorkspaceInfoCache(VersionControlServer sourceControl, String ownerName, TimeSpan maxAge)
   at Microsoft.TeamFoundation.Build.Controls.VersionControlHelper.CheckinFiles(VersionControlServer versionControl, Dictionary`2 localPathsToServerPaths, String checkinComment)
   at Microsoft.VisualStudio.TeamFoundation.Build.ProjectComponentCreator.CheckinFiles(ProjectCreationContext context, VersionControlServer versionControl, List`1 templates)
   at Microsoft.VisualStudio.TeamFoundation.Build.ProjectComponentCreator.ExecuteInternal(ProjectCreationContext context, XmlNode taskXml, Boolean validationOnly)

This turns out to be another version of the local cache refresh issue I blogged about recently. The issue was I had deleted a couple of team projects on my TFS server via the TFS Administration Console, but my local VS2010 copy did not know as the cache had not been refreshed. Unloading VS2010, reloading it so the local cache was refreshed and then the create new project works fine

Todays ISV event at Microsoft UK

Thanks to everyone who came today’s ISV session at TVP.

You can find all the slides from the event at http://blogs.msdn.com/b/ukisvdev/archive/2011/06/27/slides-and-links-from-alm-and-visual-studio-2010-event-on-the-27th-june-2010.aspx

Microsoft UK Techdays video’s available

The videos from the various Microsoft UK Techdays events can now be viewed at the UK TechDays site. This includes my session on ‘Virtualisation of the Test Environment’ and the joint one I did with James Mann on the new experience for developing SharePoint solutions in VS2010 from the Leeds event.

Speaking at Microsoft UK next week

I will be speaking at Microsoft UK’s ‘Application Lifecycle Management for Independent Software Vendors’ event next Monday. I am one of four speakers, between us well all address a variety of subjects within ALM

  • Modern Software Delivery: The continuous delivery of high quality software - Colin Bird
  • Driving Quality Throughout the Application Lifecycle - Richard Erwin
  • Extending Testing into the Lab - Richard Fennell
  • The Secrets of Repeatable Success - Adam Gilmore

I believe there are still spaces available

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

 

 

 

 

TFS 2010 SP1 Cumulative Update 1

For those of you have have not spotted it the TFS 2010 SP1 Cumulative Update 1 is now available. This is a roll up of all the fixes that have be released since TFS 2010 SP1. This form of cumulative release is going to be the way forward for TFS, so it will be easier to know what to install on a server without reading loads of QFE documents.

For more details read the full details on Brian Harry’s blog