November 2012 - Posts

TFS & Visual Studio 2012 Update 1 is available
Tue, Nov 27 2012 16:36

For those who attended Black Marble’s event today I mentioned there was an upcoming TFS and Visual Studio 2012 Update 1. Well I was out of date whilst talking, it had already been released overnight.

See Brian Harry’s blog for details and Grant Holiday’s blogs  for a nice explanation of the download options.

by But it works on my PC!
Filed under:
Did I delete the right lab?
Thu, Nov 22 2012 10:18

It was bound to happen in the end, the wrong environment got deleted on our TFS Lab Management instance. The usual selection of rushing, minor mistakes, misunderstandings and not reading the final dialog properly and BANG you get that sinking feeling as you see the wrong set of VMs being deleted. Well this happened yesterday, so was there anything that can be done? Luckily the answer is yes, if you are quick.

Firstly we knew SCVMM operations are slow, so I RDP’d onto the Hyper-V host  and quickly copied the folders that contained the VMs scheduled to be deleted. We now had a copy of the VHDs.

On the SCVMM host I cancelled the delete jobs. Turns out this did not really help as the jobs just get rescheduled. In fact it may make matters worse as the failing of jobs and their restarting seems to confuse SCVMM, took it hours before it was happy again, kept giving ‘can’t run job as XXX in use’ and losing sight of the Hyper-V hosts (needed to restart the VMM service in the end).

So I now had a copy of three network isolated VM, so I

  • Created new VMs on a Hyper-V host using Hyper-V manager with the saved VHDs as their disks. I then made sure they ran and were not corrupted
  • In SCVMM cleared down the saved state so they were stopped (I forgot to do this the first time I went through this process and it meant I could not deploy the stored VMs into an isolated environment, that wasted hours!)
  • In SCVMM put them into the library on a path our Lab Management server knows about (gotcha here is SCVMM deletes the VM after putting it into the library, this is unlike MTM Lab Center which leaves the original in place, always scares me when I forget)
  • In MTM Lab Center import the new VMs from the library
  • Create a new network isolated environment with the VMs
  • Wait……………………….

When it eventually started I had a network isolated environment back to the state it was when we in effect pulled the power out. All took about 24 hours, but most of this was waiting for copies to and from the library to complete.

So the top tip is try to avoid the problem, this is down to process frankly

  • Use the ‘mark a in use’ feature to say who is using a VM
  • Put a process in place to manage the lab resources. It does not matter how much Hyper-V resource you have you will run out in the end and be unable to add that extra VM. You need a way to delete/archive out what is not currently need
  • Read the confirmation dialogs, they are there for a reason
New book from Gojko Adzic ‘Impact Mapping’
Wed, Nov 21 2012 11:24

A common problem with getting software developed is the needing to get everyone aiming for the same goal. This too often gets lost in the development process; the real goal of the business is not communicated to the development team.  It maybe that the goal professed by the business is not the one they even really want, but their current viewpoint obscures the true goal.

In this new book from Gojko Adzic provides a excellent introduction to Impact Mapping as a tool to help address this problem. It describes using workshops and simple graphical tools as a way to tackle this problem of keeping an eye on the true goal. These are tools to use well before starting down the user story/ALM path to make sure the goal of your project is sound, known and measurable.

This is a refreshingly thin books that should be easily accessible to anyone involved in software projects irrespective of their technical skill level or team role. Well worth a look by everyone

Black Marble at the 2012 Abbey Dash
Mon, Nov 19 2012 6:28

Another good turn out this year for the Age UK Abbey Dash 10K in Leeds. Over 9000 runners this year, certainly seemed much busier than previous years.

image

 

Again Black Marble had staff members running. As with last year we did a wisdom of crowds based handicap race for the impressive Black Marble trophy (we all estimate each others expected times, the winner is who beats mean estimate the most). This year there was a tie to the second between Jon and Becky, who are as we speak negotiating over trophy sharing for the next year.

image

Congratulations to all who took part, I am sure plenty of good causes benefited from the efforts of everyone who ran

Upcoming free events from Black Marble
Wed, Nov 14 2012 15:07

Winter is rushing on, so it is time for a new season of Black Marble events in Yorkshire.

21 Nov 2012 (All day) - Whats New in SharePoint 2013

All the updates and announcements from the Microsoft SharePoint Conference around SharePoint 2013.

27 Nov 2012 (AM) - An Introduction to Windows 8 Development

We welcome Microsoft Evangelist Mike Taulty to present a morning on Windows 8 for developers.

27 Nov 2012 (PM) - ReBuild

Bringing the key announcements and developments from Microsoft Build about Windows 8

5 Dec 2012 (All day) - Architecture Forum in the North 5

Our Architecture Forum returns, now in its 5th year, and Black Marble and Microsoft once again invite you to join us for a unique opportunity to learn about the latest technologies and best practices from luminaries in the field of computing.

17 Jan 2013 (AM) - A Windows Azure Update

Take time to out to explore a round-up of what’s new in Windows Azure from the last 12 months. Join our experts for their views on what’s been happening, what’s coming and how it will impact your business.

30 Jan 2013 - The Tenth Annual Technical Update - AM

From Windows 8 to Windows Phone 8, to Visual Studio 2012 and SharePoint and Office 2013 – join us as ever for our views on the new releases, as we focus on the story for IT managers and Business Decision Makers.

30 Jan 2013 - The Tenth Annual Technical Update - PM

From Windows 8 to Windows Phone 8, to Visual Studio 2012 and SharePoint and Office 2013 – join us as ever for our views on the new releases, as we focus on the story for developers and Technical Decision Makers.

For full details and registration check out the Black Marble site

by But it works on my PC!
Filed under:
Why does ‘Send to > email link’ in SharePoint open Chrome on my PC?
Tue, Nov 13 2012 13:44

I must have clicked something in error on my Win 8 PC as when I open one of our SharePoint 2010 sites and select a file, right clicked and selected Send To > Email Link instead of an Outlook email opening my PC tries to open Chrome.

A bit of quick digging showed the issue was that the file association for mailto: was wrong. You can check this setting in IE > Internet Options > Programs > Internet Programs > set Programs (button)

image

Once I changed this to Outlook I got the behaviour I expected

More thoughts on addressing TF900546 ‘Unable to load one or more of the requested types’ on TFS2012
Mon, Nov 12 2012 5:33

A while ago I posted about seeing the TF900546 error when running unit tests in a previously working TFS 2012 build. The full error being:

TF900546: An unexpected error occurred while running the RunTests activity: 'Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.'.

Well late last week this problem came back with avengeance on a number of builds run on the same build controller/agent(s). Irritatingly I first noticed it after a major refactor of a codebase, so I had plenty of potential root causes as assemblies had been renamed and it was possible they might not be found. However, after a bit of testing there were no obvious candidates as all tests worked fine locally on my development PC, and a new very simple test application showed the same issues. It was defiantly an issue on the build system.

I can still find no good way to debug this error, Stackoverflow mention Fuslogvw and WinDbg, as well as various copy local settings and the like. Again all seems too much as this build was working in the past, just seemed to stop. I tried a couple but got no real information, and the error logs were empty.

In the end I just tried what I did before (as I could think of no better tactic to pin down the true issue). I went into the build controller config, removed the reference to the custom assemblies, saved this settings (causing a controller restart), then put it back (another restart of the controller)

image

After this my test started working again, with no other changes

Interesting a restart of VM running the build controller did not fix the problem. However this does somewhat chime with comments in the StackOverFlow thread that causing the AppPool in MVC apps to rebuild completely, ignoring any cached assemblies, seems to fix the issue.

Change in the System.AssignedTo in TFS SOAP alerts with TFS 2012
Fri, Nov 9 2012 14:29

Ewald’s post explains how to create a WCF web service to act as an end point for TFS Alerts. I have been using the model with a TFS 2010 to check for work item changed events, using the work item’s System.AssignedTo field to retrieve the owner of the work item (via the TFS API) so I can send an email, as well as other tasks (I know I could just send the email with a standard alert).

In TFS 2010 this worked fine, if the work item was assigned to me I got back the name richard, which I could use as the to address for the email by appending our domain name.

When I moved this WCF event receiver onto a TFS 2012 (using the TFS 2012 API) I had not expected any problems, but the emails did not arrive. On checking my logging I saw they were being sent to fennell@blackmarble.co.uk. Turns out the issue was that the API call

value = this.workItem.Fields[“System.AssignedTo ”].Value.ToString();

was returning the display name ‘Richard Fennell’, which was not a valid part of the email address.

The best solution I found, thus far, was to check to see if had a display name in the AD using the method I found on stackoverflow. If I got a user name back I used that, if I got a empty string (because I have been passed a non display name) I just use the initial value assuming it is a valid address.

Seems to work but this there a easier solution?

Cannot run coded ui test on a TFS lab due to lack of rights to the drops folder
Fri, Nov 9 2012 14:09

Whilst setting up a TFS 2012 Lab management environment for Coded UI testing we got the problem that none of the tests were running, in fact we could see no tests were even being passed to the agent in the lab

image

On the build report I clicked on  the ‘View Test Results’ which loaded the result in Microsoft Test Manager (MTM)

image

and viewed the test run log, and we saw

image

The issue, it claimed, was that the build controller did not have rights to access the drop folder containing the assembly with the CodedUI. tests.

Initially i thought the issue was the test controller was running a ‘local service’, so I changed it to the domain\tfsbuild account (which obviously has rights to the drops folder as it put the files there) but still got the same error. i was confused.

So I checked the event log on the build controller and found the following

image

The problem was my tfslab account, not the local service or tfsbuild one. So the message shown in the build report was just confusing, mentioning the wrong user. The lab account is the one configured in the test controller (yes you have to asked how had I missed that when I had been into the same tools to change the user the test controller ran as!)

image

As soon as I granted this tfslab user rights to the drops folder all was OK

Using IISExpress for addresses other than localhost
Tue, Nov 6 2012 16:34

I recently had the need to use IISExpress on Windows 8 to provide a demo server to a number of Surface RT clients. I found this took me longer than I expected. It might be me but the documentation did not leap out.

So as a summary this is what I had to do, let us say for example that I want to serve out http://mypc:1234

  • Make sure you have a project  MyWebProject in Visual Studio that works for http://localhost:1234 using IISExpress
  • Open the TCP port 1234 on the PC in the Control Panel > Admin Tools > Firewall
  • Edit C:\Users\[current user]\Documents\IISExpress\config\applicationhost.config and find the site name section for your Visual Studio project. And change the <binding protocol="http" bindingInformation="*:1234:localhost" /> to <binding protocol="http" bindingInformation="*:1234:*" />.  This means IISexpress can now listen on this port for any IP address
  • You finally need to run IISExpress with administrative privileges. I did this by opening a PowerShell prompt with administrative privileges and running the command  C:\Program Files\IIS Express\iisexpress.exe /site:MyWebProject

Once all this was done my client PCs could connect

Reinstalling again…
Fri, Nov 2 2012 12:10

Just completing the second reinstall of Windows 8 on my Lenovo W520 in 10 days due to my new SSD failing and needing to be replaced.

To try to ease the process I though I would try putting on the miscellaneous tools I use such as 7Zip, Filezilla etc. using Chocolatey. I have to say first impressions are good, one command and the product is on, the files pulled from the appropriate site.

Obviously there is the issue that packages are may not be kept up to date, unlike Nuget (which is at Chocolatey’s core) the packages are not stored on the Chocolatey site. I noticed the SysInternal package is a bit behind, but I could always submit the updated package myself couldn’t I.

Emboldened by my success with simple utilities I tried Eclipse and Java, they worked fine.

The biggest gain was git, posh git and git-tf. Usually there is a degree of file/path editing here, but with chocolatey just a single command for each.

To find out more why not listen to Herding Code podcast on the subject