Fix for ‘Cannot install test agent on these machines because another environment is being created using the same machines’

We have recently been upgrading our TFS 2012QU1 Lab Management system from SCVMM 2008 to SCVMM 2012 SP1. This has not been the nicest experience, we are preparing at least one joint blog post from Rik, Rob and myself on the joys, yes it did take everyone, a lovely cross skill problem.

We are now in the process of sorting out the state of running environments transferred between the systems. I thought I would start with an easy one, a single non-domain joined VM.

So after the upgrade this VM appeared as a running VM on one of the Hyper-V hosts, I could add it to a new environment, which I did. All appeared OK, the environment was created but Lab Management could not upgrade the Test Agents. If you tried the ‘reinstall agents’ option in Test Manager you got the error ‘cannot install test agent on these machines because another environment is being created using the same machines’

image

All very confusing and a hunt on the web found nothing on this error.

The fix I found (might be another way) was to

  1. Connect to the VM via MTM
  2. Uninstall the TFS 2012 RTM Test Agent.
  3. Install the TFS 2012 QU1 test agent from the Test Agents ISO (which I had unpacked to network share so I could run the vstf_testagent.exe easily)
  4. When the install was complete the configuration wizard ran, I set the agent to run as the local administrator and pointed it at one of our test controllers

image

Once the Test Agent configuration completed and the agent restarted it connected to the test controller and the environment reported itself as being ready.

So one (simple) environment down, plenty more to go

For those hard to mock moments – Microsoft Fakes or Typemock Isolator?

About a year ago I wrote a post ‘Now that VS11 has a fake library do I still need Typemock Isolator to fake out SharePoint?’. Well this discussion becomes relevant for more people as with Visual Studio 2012.2 (currently available as a CTP) the Microsoft Fakes move from the Ultimate SKU to the Premium SKU.

From my experience the Ultimate SKU is not present on too many developer’s PCs. It is most commonly found on the PCs of the team leads, software architects or test developers (managing coded UI/load testing etc. efforts). If a team was historically going to use Microsoft Fakes then they had to buy more Ultimate SKUs; as what is the point of a unit test using a mocking framework that only part of the team can run?

The Premium SKU of Visual Studio is far more common, I would go as far as to say it is the corporate standard for development. Now as this SKU contains Test Manager (since 2012 RTM) it covers most jobs most developers do. Ultimate is just needed for the specialists in the team. Adding fakes to the Premium SKU really makes sense if Microsoft want to drive adoption.

So now the question of whether to use Microsoft Fakes or Typemock Isolator (or Telerik JustMock a product I have to admit I have not used in anger) is rebalanced as there is a fair chance a development team may all be licensed for Microsoft Fakes as they have the premium SKU. The question becomes is the cost of Isolator justified by the features it offers over and above Microsoft Fakes?

This is not an uncommon form of question for any third party add-in to Visual Studio. Visual Studio offers refactoring, but I think few would argue that Resharper or RefactorPro! don’t offer more features that justify their cost.

For me the big advantage of Typemock is ease of use and consistent syntax across all usage patterns. This could be just due to familiarity, but the fact I don’t need to manually generate the fake assembly is a bonus. Also that Isolator’s fluent API is basically the same as Moq and FakeItEasy so causes less friction when coming to advanced mocking from these tools. A team can use the free basic version of Typemock Isolator until they need the advanced features when they need to license it.

Fakes is a different way of working to most other frameworks, working at a different level inside Visual Studio. A disadvantage of this is that it does not lend itself well to refactoring, you are probably going to have to regenerate the fake assemblies after any refactor, which can be slow. Also this makes refactoring a bit more risky, as you also have to touch unit tests, a manual operation.

I think at this time for me Isolator still offers advanced features and easy of use advantages that justifies the license cost. However, as with all tools this is an ever changing field, I expect to see new features and changes for all the players in the fakes market as they all aim to better address the problems cause by the poorly architecture of applications/frameworks such as SharePoint and of course our own poorly designed legacy code.

VS Anywhere–Have a look at distributed pair programming

Whilst at the MVP Summit in Redmond last week there were MVP2MVP sessions, these are much like DDD conferences we have in the UK, sessions delivered by MVPs on their experiences and products they offer.

One of the most interesting I saw last week was VS Anywhere. This is an extension to Visual Studio that allows distributed pair programming. This far more than desktop sharing in Skype or Lync, think more like the concurrent document editing in Office 365.

Why not have a look at the promo video or sign up for a free trial. If you have distributed teams, or the need to support a client’s developers remotely might be just the thing.

TFS Lab Management and Windows 8 and Server 2012

TFS Lab Management can be a good way to manage your development and test environments, providing a means to more easily store, deploy and snapshot environments. Problem is they are not magic, you need to create the virtual machines you will use. You can use tools such the ALM Rangers VM Factory to speed this process, but you still need the source ISOs to create the VMs.

Until the release of System Center 2012 SP1 (and TFS 2012 QU1) Lab Management did not support Windows 8 or Server 2012. This was a limitation with the System  Center 2008 Virtual Machine Manager. But with the release of these new versions you now have no excuse not to have a look at TFS Lab Management for even your most cutting edge projects. And remember you are licensed Lab Management (including SC-VMM for the sole use of TFS Lab Management) as part of your TFS 2012 MSDN license.

So if you want to have a look at System Center or Windows Server 2012 why not try the new evaluation downloads on TechNet

Running an external command line tool as part of a Wix install

I have recently been battling running a command line tool within a Wix 3.6 installer. I eventually got it going but learnt a few things. Here is a code fragment that outlines the solution.

<Product ………>
……… loads of other Wix bits

<!– The command line we wish to run is set via a property. Usually you would set this with <Property /> block, but in this case it has to be done via a
       
CustomAction as we want to build the command from other Wix properties that can only be evaluated at runtime. So we set the
       whole command line  including command line arguments as a CustomAction that will be run immediately i.e. in the first phase of the MSIExec process  
       while the command set is being built.

     Note that the documentation say the command line should go in a property called QtExecCmdLine, but this is only true if the CustomAction
    is to be run immediately. The CustomAction to set the property is immediate but the command line’s execution CustomAction is deferred, so we
    have to set the property to the name of the CustomAction and not QtExecCmdLine  –>

<CustomAction Id=’PropertyAssign’ Property=’SilentLaunch’ Value=’&quot;[INSTALLDIR]mycopier.exe&quot; &quot;[ProgramFilesFolder]Java&quot; &quot;[INSTALLDIR]my.jar&quot;’ Execute=’immediate’ />

  <!—Next we define the actual CustomAction that does the work. This needs to be deferred (until after the files are installed) and set to not be impersonated
          so runs as the same elevated account as the rest of the MSIExec actions. (assuming your command line tool needs admin rights –>
  <CustomAction Id="SilentLaunch" BinaryKey="WixCA"  DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no" />
 
  <!—Finally we set where in the install sequence the CustomActions and that they are only called on a new install
          Note that we don’t tidy up the actions of this command line tool on a de-install –>
  <InstallExecuteSequence>
   <Custom Action="PropertyAssign" Before="SilentLaunch">NOT Installed </Custom>
   <Custom Action="SilentLaunch" After="InstallFiles">NOT Installed </Custom>
  </InstallExecuteSequence>

 
</Product>

So the usual set of non-obvious Wix steps, but we got there in the end

New release of Typemock Isolator

Typemock have released a new version of Isolator (7.3) that addresses some problems they have been having with Visual Studio 2012 and Windows 8

  • Resolved all issues concerning the breaking MS update
  • Boosted performance across the board (up to 44% faster)
  • Enhanced SmartRunner UI
  • Improved mocking capabilities
  • Better integration with .NET development ecosystem

You can download this release, or a free trial if you don’t have an Isolator license, from the Typemock site

More in rights being stripped for the [team project]\contributors group in TFS 2012 when QU1 applied and how to sort it.

I recently wrote a post that discussed how the contributor rights had been stripped off areas in TFS 2012 server when QU1 was applied, this included details on the patches to apply the manual steps to resolve the problem.

Well today I found that it is not just in the area security you can see this problem. We found it too in the main source code repository. Again the [Team project]\contributors group was completely missing. I had to re-add it manually. Once this was done all was OK for the users

image

FYI: You might ask how I missed this before, most of the  users  on this project had higher levels of rights granted by being members of other groups. It was not until someone was re-assigned between team we noticed.

Getting Windows Phone 7.8 on my Lumia 800

Microsoft have release Windows Phone 7.8 in the last few days. As usual the rollout appears to be phased, I think based on serial number of your phone. As with previous versions you can force the update, so jumping the phased rollout queue. The process is

  1. Put the phone in flight mode (so no data connection)
  2. Connect it to your PC running Zune, it will look to see if there is an OS update. If it finds it great, let it do the upgrade
  3. If it does not find it, select the settings menu (top right in Zune)
  4. You need to select the update menu option on the left menu
  5. Zune will check for an update, about a second or two after it starts this process disconnect the PC from the Internet. This should allow Zune to get a list of updates, but not the filter list of serial numbers. So it assume the update is for you.
  6. You should get the update available message, reconnect the internet (it needs to download the file) and continue to do the upgrade

You will probably have to repeat step 5 a few times to get the timing correct

I also had to repeat whole process 3 three for 3 different firmware and OS updates before I ended up with 7.8. But now I have multi size tiles and the new lock screen.

Or if you don’t fancy all the hassle you could just wait a few days