January 2012 - Posts

Have you tried switching it on and off again? Go on be aggressive!
Tue, Jan 31 2012 6:43

We have been building ‘standard’ environments for our TFS Lab Management system. Environments that can be used for most of the projects we are involved in without too much extra setup e.g. a small domain controller VM and a Server VM with SQL and SharePoint. These environments have a series of snapshots so it can be used in a number of ways e.g if we just want SQL and IIS we just go back to a snapshot prior to SharePoint being installed.

When trying to deploy one of these environments we saw a couple issues.

Capacity

First we got the error that there was not a suitable host with enough capacity to host the environment (remember all the VMs in a network isolated environment need to be on the same Hyper-V host). This can be a bit of a red herring as with dynamic memory and other new Hyper-V features there is often the capacity there (see Tiago’s post on this for more details). The fix here was to set TFS to allow aggressive deployment using the command

C:\Program Files\Microsoft Team Foundation Server 2010\Tools>tfsconfig lab /hostgroup /collectionName:myTpc  ​/labenvironmentplacementpolicy:aggressive /edit /Name:"My hosts group"

Initial Startup

The next problem I saw was that when the new environment was deployed it did not started cleanly. The first time an environment is started it seems to take longer than subsequent starts (assume there is some initial configuration done). Basically in this case network isolation did not start correctly, hence build and testing capabilities also failed.

The fix was simple, shut down the environment and start it again. The tried and trusted IT answer to all problems. This time it started fine, and was faster to start.

Now I have not see this issue every time I deploy. When I deployed the same environment again and it worked perfectly first time. I suspect it was really a capacity issue on the underlying Hyper-V server causing some delay, but I am running in aggressive mode so I should expect this.

More links from our SDL event
Fri, Jan 27 2012 14:16

If you want to hear a bit more detail on some of the common security issues we discussed at yesterdays SDL event why not listen to Troy Hunt Secures ASP.NET recent show on .NET Rocks or download his PDF ‘OWASP Top 10 for .NET developers’

by But it works on my PC!
Filed under:
Links from our SDL event today
Thu, Jan 26 2012 13:30

Thanks to everyone who attended our SDL event today. Here are a few links to information  we mentioned

by But it works on my PC!
Filed under:
New 1.3.0.0 release of the Community TFS Build Extensions for TFS 2010
Wed, Jan 25 2012 15:53

A new 1.3.0.0 release of the Community TFS Build Extensions has been published today. This contains some fixes  and two new activities

Black Marble launches new series of free online event
Thu, Jan 19 2012 7:31

For many years Black Marble has run free events on a wide range of technologies. Originally we only ran these locally in Yorkshire, but as time progressed we have run them across the UK and Eire. They are a great way to help your staff whether technical or managerial get up to speed with new developments in our industry.

For 2012 we have decided to try running some events online. The format for these events will be a short 30 minute interactive sessions where you will have the chance to see a short presentation and/or demonstration on a technology followed by a Q&A session with the presenter.

Hopefully these will prove to be as successful as our other events.

by But it works on my PC!
Filed under:
TF266026 error when a workflow will not start in a lab environment
Wed, Jan 18 2012 11:05

A common cause of the TF266026 error is because when the build agent tries to start (it is the build agent that runs the workflows in Lab Management) it cannot access the custom assemblies folder as defined for its parent build controller. Obviously this problem only occurs if you have  set a custom assemblies path for parent build controller.

image

The reason for the error is because the agent is running as the Lab Management service account, in my case tfs2010lab, as defined for the TPC in the TFS Administration Console. This account by default has no rights to the source folder assigned for the custom assemblies. This is not usually an issue until it needs to access source control to load custom assemblies (which actually it probably does not ever use as it is not building code!).

image

As soon as this service account is granted access  to this folder, by making it a  reader, contributor or builder on the team project, the problem goes away.

‘Showing a modal dialog box or form when the application is not running in UserInteractive mode’ error upgraded to TFS build extensions 1.2.0.0
Tue, Jan 17 2012 9:14

Whilst upgrading a TFS 2010 build today to the new 1.2 release of the Community TFS Build Extensions we hit an issue. All seemed to go OK until the build tried to use the StyleCop activity, which failed with the error

Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.

After a bit of pointless fiddling we decided the only option was to set the build service in question to run interactively (set on the build service properties in TFS administration console on the build box). Once this was done the following dialog popped up

clip_image001 

On checking the assemblies copied into the CustomAssemblies folder referenced by the build controller we found we had an older version of this file (from the previous release of the build extensions).

Once we replaced this file we got a bit further, we did not get a dialog, but the build failed with the error in the log

Error: Could not load file or assembly 'StyleCop, Version=4.6.3.0, Culture=neutral, PublicKeyToken=f904653c63bc2738' or one of its dependencies. The system cannot find the file specified.. Stack Trace:    at TfsBuildExtensions.Activities.CodeQuality.StyleCop.Scan()    at TfsBuildExtensions.Activities.CodeQuality.StyleCop.InternalExecute() in D:\Projects\teambuild2010contrib\CustomActivities\VS2010\MAIN\Source\Activities.StyleCop\Stylecop.cs:line 134    at TfsBuildExtensions.Activities.BaseCodeActivity.Execute(CodeActivityContext context) in D:\Projects\teambuild2010contrib\CustomActivities\VS2010\MAIN\Source\Common\BaseCodeActivity.cs:line 67.

The issue was we had not upgraded the StyleCop assemblies in the CustomAssemblies folder to match the ones the 1.2.0.0 release of the build extensions was built against (it needed 4.6.30, note not the latest 4.7.x.x.). So we changed these files to the 4.6.3.0 release and the build worked

Interestingly note that the file names have changed from the 4.4.x.x. to 4.6.x.x release of StyleCop from Microsoft.StyleCop.*.dll to just StyleCop.*.dll, so make sure you delete the old files in the CustomActivities folder to avoid confusion.

image

To the top tip here is to make sure you update all of the assemblies involved in your build to avoid dependency issues.

Confused over the workflow to get an environment setup in TFS Lab Management?
Tue, Jan 17 2012 5:48

It can be a bit confusing to get work out which tools to use at which stages required to get a lab environment up and running in TFS. Here is a basic workflow showing what you need to do in System Center Virtual Machine Manager prior to starting in MTM Lab Center

Note: if you want to copy environments between TFS Team project Collections have a look at this post

image

TF260073 incompatible architecture error when trying to deploy an environment in Lab Manager
Tue, Jan 17 2012 3:21

I got a TF260073, incompatible architecture error when trying to deploy a new virtual lab environment using a newly created VM and template. I found the fix in a forum post.

The issue was that when I had build the VMs, I had installed the Lab Management agents using a VMprep DVD ISO and mounted it using ‘share image instead of copying it’ option. This as the name implies means the ISO is mount from a share not copied to the server running the VM, this save time and disk resources. When I had stored my VM into the SCVMM Library I had left this option selected i.e the VMPrep.iso mounted. All I had to do to fix this issue was open the settings of the VM stored in the SCVMM Library and dismount the ISO, as shown below

image

Interestingly the other VM I was using in my environment was stored as template and did not suffer this problem. When creating the template I was warning that it could not be created if an ISO was mounted in this manner. So the fact I had a problem with my VM image should not have been a surprise.

Getting a ‘File Download’ dialog when trying to view TFS build report in Eclipse 3.7 with TEE
Fri, Jan 13 2012 5:17

When using TEE in Eclipse 3.7 on Ubuntu 11.10 there is a problem trying to view a TFS build report. If you click on the report in the Build Explorer you would expect a new tab to open and the report be shown. This is what you see in Eclipse on Windows and on older versions of Eclipse on Linux. However on Ubuntu 11.10 with Eclipse 3.7 you get a File Download dialog.

image

I understand from Microsoft this is a known issue, thanks again to the team for helping get to the bottom of this.

The problem is due to how Eclipse manages its internal web browser. Until version 3.7 it used the Mozilla stack (which is still the stack used internally by TEE for all its calls), but with Eclipse 3.7 on Linux it now uses WebKit as the stack to open request URL such as the build report. For some reason this is causing the dialog to be show.

There are two workaround:

Set Eclipse to use an external browser

In Eclipse –> Windows –> Preference, select use external browser

image

 

When you now click on the build details an external browser is launched showing the results you would expect.

image

 

Switch Eclipse back to using Mozilla as its default

You can switch Eclipse back to using mozilla as its default. In your eclipse.ini set

-Dorg.eclipse.swt.browser.DefaultType=mozilla

Once this is done Eclipse should behave as expected, opening a tab to show the build report within Eclipse.

 

image

Changed my phone to a Nokia
Tue, Jan 10 2012 6:52

I swapped to a Nokia Lumia 800 yesterday from my LG E900, all very quick an easy after my experience last month.

My first impressions

  1. the on/off/volume buttons were better placed for a left hander on the LG, but I expect I will get used to that.
  2. the poor reception in my house was not the LGs fault – just a bad reception area
  3. the Nokia does seem faster
Problems finding XULRunner when running TEE11 CTP1 on Ubuntu and connecting to TFS Azure – a solution
Sun, Jan 8 2012 15:41

I recently got round to taking a look at Team Explorer Everywhere 11 CTP1. This is the version of TEE that allows you to access the Azure hosted preview of the next version of TFS using Eclipse as a client. I decided to start with  a clean OS so

  1. Downloaded the Ubuntu 32bit ISO
  2. Used this ISO to create a test VM on my copy of VirtualBox (currently using VirtualBox as this allows me to create 64bit and 32bit guest VMs on my Windows 7 laptop without have to reboot  to my dual boot Windows 2008 partition to access Hyper-V)
  3. Selected default installation options for Ubuntu
  4. When completed used the Ubuntu Software Centre tool to install Eclipse 3.7
  5. Downloaded the Team Explorer Everywhere 11 CTP1 and installed the Eclipse plug as detailed on the download page.
  6. Once installed I then tried to connect to our in house TFS2010 server from with Eclipse – it all worked fine

I next tried to connect to my project collection on https://tfspreview.com and this is where I hit a problem….

Instead of getting the expected LiveID login screen I got an error dialog saying ‘No more handles [Could not detect registered XULRunner to use]

clip_image002

A quick search showed this is a known issue, basically Ubuntu has stopped distributing XULRunner. It needs to be installed manually as detailed in the post. Problem was, unlike in the post, when I followed this process it had no effect on the problem, so time for more digging with the excellent assistance of Shaw from the TEE team at  Microsoft.

The first suspect was that an environment variable MOZILLA_FIVE_HOME, which, according  to the SWT FAQ, needed to be set to let Eclipse know where to find XULRunner. Checking the Eclipse Help->Team Explorer Support… dialog

clip_image002[5]

seemed to show the correct setting had been picked up automatically. So as expected, on setting the environment variable it had no effect on the problem. So just to make sure I set the variable in eclipse.ini file using the setting

-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner-1.9.2.24

This changed the error message, and gave the hint to real problem.

clip_image002[7]

XULRunner was failing to load as other dependencies were missing.

At this point I could have started to chase down all these dependencies. However, I realised the issue was the Ubuntu distribution of Eclipse, it just had too many bits missing that you need to login to TFS Azure. So I removed the Ubuntu sourced Eclipse installation and downloaded the current version of  Eclipse direct for the Eclipse home site.

  1. I unzipped this distribution
  2. Installed TEE CTP1 as before
  3. Check I could access our TFS 2010
  4. And checked I could login via http://tfspreview.com

image

So success, the tip being using the official Eclipse distribution, as you never know what another distribution might have removed.

Jan 2012 Agile Yorkshire meeting – An Extreme Hour
Fri, Jan 6 2012 4:27

Agile Yorkshire is kicking off the New Year on the Tuesday Jan 10 at Old Broadcasting House, Leeds where the subject will be Extreme Programming(XP). The session will be based around an Extreme Hour: a hands-on XP project miniature with no coding experience required. Then off to be pub to continue the chat.

Unfortunately I cannot make the session, but I am sure it will be interesting, especially if you have not tried an Extreme Hour.

Radio TFS is back
Tue, Jan 3 2012 4:21

In case you had not noticed, the Radio TFS podcast is back after an eight month hiatus. A good place to keep in touch the the new announcements related to VS11

by But it works on my PC!
Filed under: