Rory Primrose

Learn from my mistakes, you don't have time to make them yourself

View project on GitHub

Quick Poll–UX of UI navigation for list with a single item

I’m after some feedback from the community regarding the UX of UI navigation when dealing with a list of items where there is only one item in the list.

I have a scenario in a UI where there is a list of subscriptions for a user account. Most of the time (~>90%) there will only be one subscription. There are two options for handling this.

  1. Always display the list when the user navigates to the list UI and force the user to manually select the only item available
  2. Automatically redirect the user to the item display screen if there is only one item

Option #1 is consistent but includes an unnecessary navigation (+ human intervention). Option #2 is streamlined, but provides an inconsistent UX when the list changes to have a second item.

I have leant towards #2 because of the expected metrics of my specific scenario in addition to it being more streamlined. The point of inconsistency is a thorn in my side however.

Thoughts? Votes? Any UX experts want to shed some opinions?

Read More

Finding solutions not covered by automated builds

I am slowing building a set of automated tasks in my current role as a TFS administrator to verify the state of TFS. My latest task looks for solutions that are not covered by automated builds.

It’s a fairly straight forward task that enumerates solution files and matches them to build definitions across all projects and collections in a TFS instance.

Read More

Refreshing an expired STSTestCert WIF certificate

I have been using WIF for the last couple of years on a few of my projects and the STSTestCert gets a bit of a workout on my development machines. This certificate is only valid for 12 months. All the applications that use this test certificate will fail to execute authentication requests once this certificate has expired.

Here is the easiest way to renew the certificate.

  1. Open up MMC and attach the Certificate Manager plugin for the local machine.
  2. Navigate to Certificates (Local Computer) -> Personal -> Certificates.
  3. Select and delete the expired STSTestCert certificate.
  4. Open VS with elevated rights
  5. Add a new solution
  6. Add a new STS project to that solution using the Tools -> Add STS Reference… menu item
  7. Continue through the wizard
  8. Refresh the MMC console and you should now have a fresh STSTestCert

image

Read More

How much do I love the yield statement?

Quite simply, a lot. The yield statement seems to be such a simple part of C# yet it can provide such amazing power (being delayed enumeration). Outside of that power however, it can provide beautiful simplicity.

Take the following abstract class for example:

Read More

Configuring a TFS 2010 build agent to compile SharePoint 2010 projects

I’ve been doing several TFS consulting gigs over the last couple of years. The one thing that keeps popping up is the requirement to build several types of platforms using TeamBuild/TFSBuild. My preference is to isolate build agents and their customisations. This means for example that I have a mix of build agents like the following:

  • Standard (full VS install + any common additions - WiX for example)
  • SharePoint
  • BizTalk

Tagging the build agents and configuring the build definitions for those tags then allows the build to be directed to the correct build agent.

Read More

Integration testing with Azure development storage

I’ve been working on some classes that write data to Azure table storage. These classes of course need to be tested. Unfortunately the development fabric only spins up when you F5 an Azure project. This is a little problematic when the execution is from a unit test framework.

Some quick searching brought up this post which provides 99% of the answer. The only hiccup with this solution is that it is targeting the 1.0 version of the Azure SDK. I have updated this code to work with the 1.6 version of the SDK.

Read More

Performance Testing a Load Test

Running a load test in Visual Studio is a great way to put your code under stress. The problem is that once you have identified that there is a potential performance issue, how do you then narrow it down to particular methods in your code base. Using a Performance Session is great for this.

The problem is that Visual Studio does not provide out of the box support for running a performance session against a load test. There is a reasonably easy workaround though. Any other profiling tool will also work using the same technique. The trick is to get the performance session to manually profile mstest.exe as it runs the load test.

Read More

Movember - Please donate

It’s not often that I post something personal on this blog. Movember is an important cause so I’ll make an exception.

It’s Movember and time to focus on men’s health. To show my commitment, I’m donating my face to the cause by growing a moustache for the entire month of November, and need your support. My Mo will spark conversations, and no doubt generate some laughs; all in the name of raising vital awareness and funds for prostate cancer and male depression.

Why am I so passionate about men’s health?

  • 1 in 9 men will be diagnosed with prostate cancer in their lifetime
  • This year 20,000 new cases of the disease will be diagnosed
  • 1 in 8 men will experience depression in their lifetime

I’m asking you to support my Movember campaign by making a donation by either:

  • Donating online at: http://www.movember.com/m/2443216
  • Writing a cheque payable to ‘Movember’, referencing my Registration ID: 2443216 and mailing it to: Movember, PO Box 60, East Melbourne, VIC, 8002, Australia

If you’d like to find out more about the type of work you’d be helping to fund by supporting Movember, take a look at the Programs We Fund section on the Movember website: http://au.movember.com/about

Thank you in advance for supporting my efforts to change the face of men’s health.

Rory Primrose

Read More

AssemblyVersion regular expression

It seems that I keep having to come up with a regular expression that validates and parses a version string. I often use this for customising TFS build workflows for extracting and using application version information.

The AssemblyVersionAttribute appears to have the following rules:

  • Major version is required
  • Minor version is optional and will default to 0 if not specified
  • Minor version cannot be *
  • Build and Revision versions are optional and may be *
  • Revision number cannot be specified if the build number is *

The following is the regular expression that covers all these rules.

Read More

Getting the X509Certificate from a remote HTTPS resource

How do you download the X509Certificate that secures a HTTPS channel? I want to do this for two reasons.

  1. Identify the reason for a trust failure
  2. Identify if the certificate is about to expire

I ran all sorts of searches on the net about how to get the certificate of the remote host. Unfortunately the results were not quite what I was after.

The answer is that the certificate is provided by HttpWebRequest.ServicePoint.Certificate. The tricky bit is that the certificate is only available once a response has come back from the host. This makes sense, but it is misleading that the certificate based on the response is stored against the original request object. It is also a little confusing that the certificate is available on the request when the attempt to get the response threw an exception (a failed certificate trust for example).

Read More