Introducing Stack Mechanics

Andrew Harcourt Thu 5 Oct 2017

After living under a rock for far too long, I'm excited to introduce Stack Mechanics.

I've teamed up with two great friends of mine, Damian Maclennan and Nick Blumhardt to launch a series of deep-dive courses in distributed systems, microservices architectures and continuous delivery.

Don't panic - I'm not leaving ThoughtWorks :)

The longer version: Damian, Nick and I, alongside numerous other great engineers, have spent a lot of time solving the hard problems that organisations encounter when trying to move away from monolithic, legacy systems. We've seen lots of places like the potential that microservices offer with respect to organisational agility and independence, but generally they've been completely unprepared for the inherent complexities in such systems and how to manage the trade-offs. Usually we weren't lucky enough for it to be a green-fields project, and as a result we've all inherited our share of legacy, tighly-coupled systems with ugly, scary integrations, unknown black boxes, business logic hidden in integration layers (or ESBs, or stored procedures, or BPM layers), and with the many and various failure modes inherent in such ecosystems.

We arrived at a set of practices, patterns, techniques and tools that helped us solve these kinds of problems and we've had a lot of success at it. Unfortunately, we still see so many organisations making the same kinds of mistakes, through the best of intentions, that we first encountered many years ago. Many teams start off well but are unaware of the pitfalls; many have no idea how to even get started.

We've decided to get together and offer deep-dive training based on our real-world experiences. We're kicking off in November 2017 with a three-day, hands-on workshop on .NET architecture, microservices, distributed systems and devops. There will be both theory and practical sessions, covering topics like:

  • Design Patterns for maintainable software
  • Test Driven Development
  • DevOps practices such as monitoring and instrumentation
  • Continuous delivery
  • Configuration patterns
  • REST API implementation
  • Microservices
  • Asynchronous messaging
  • Scaling and caching
  • Legacy system integration and migration

Attendees will work with us and together to build an actual ecosystem to solve a small but real-world problem.

Book your ticket for the November 2017 (Brisbane) workshop now to lock in early-bird pricing.

We'll be scheduling other workshops in other cities (and probably some more in Brisbane), so register your interest in other dates and cities via, follow us on Twitter via @stack_mechanics and on Facebook as Stack Mechanics.

Command-line Add-BindingRedirect

Andrew Harcourt Tue 4 Oct 2016

One of the things I try to do as part of a build pipeline is to have automatic package updates. My usual pattern is something along the lines of a CI build that runs on every commit and every night, plus a Canary build that updates all the packages to their latest respective versions.

The sequence looks something like this:

  1. The Canary build:
    1. pulls the lastest of the project from the master branch;
    2. runs nuget.exe update or equivalent;
    3. then compiles the code and runs the unit tests.
  2. If everything passes, it does (roughly) this:

    git checkout -b update-packages
    git add -A .
    git commit -m "Automatic package update"
    git push -f origin update-packages
    # Note: There's a bit more error-checking around non-merged branches and so on,
    # but that's fundamentally it.
  3. The CI build then:

    1. picks up the changes in the update-packages branch;
    2. compiles the code (yes, again), to make sure that we didn't miss anything in the previous commit);
    3. runs the unit tests;
    4. deploys the package to a CI environment;
    5. runs the integration tests; and
    6. if all is well, merges the update-packages branch back down to master.

For what it's worth, if a master build is green (and they pretty much all should go green if you're building your pull requests) then out the door it goes. You do trust your test suite, don't you? ;)

All of this can be done with stock TeamCity build steps with the exception of one thing: the call to nuget.exe update doesn't add binding redirects and there's no way to do that from the console. The Add-BindingRedirect PowerShell command is built into the NuGet extension to Visual Studio and there's no way to run it from the command line.

That's always been a bit of a nuisance and I've hand-rolled hacky solutions to this several times in the past so I've re-written a slightly nicer solution and open-sourced it. You can find the Add-BindingRedirect project on GitHub. Releases are downloadable from the Add-BindingRedirect releases page.

Pull requests are welcome :)

ConfigInjector 2.2 is out

Andrew Harcourt Tue 6 Sep 2016

ConfigInjector 2.2 is out and available via the feed.

This release is a small tweak to allow exclusion of settings keys via expressions as well as via simple strings. Thanks to Damian Maclennan for this one :).

To exclude settings keys via exact string matches, as per before:

                         .RegisterWithContainer(configSetting => builder.RegisterInstance(configSetting)
                         .ExcludeSettingKeys("DontCareAboutThis", "DontCareAboutThat"))

To exclude settings keys via expression matches:

                         .RegisterWithContainer(configSetting => builder.RegisterInstance(configSetting)
                         .ExcludeSettingKeys(k => k.StartsWith("DontCare"))

Joining ThoughtWorks

Andrew Harcourt Mon 12 Oct 2015

As of this morning, I've officially started at ThoughtWorks. My business card will read "Principal Consultant" and I'll still be based in Brisbane.

Let's see what the future holds :)

More on software...

More on life, the universe and everything...

About me

My name is Andrew Harcourt.

I'm a software engineer and project rescue specialist. I'm a Principal Consultant and Market Tech Principal at ThoughtWorks, a co-founder at Stack Mechanics and in my spare time (ha!) I also run my own photography business, Ivory Digital.


I'm a solutions architect and software engineer with extensive experience in large-scale, high-load, geographically-distributed systems. I specialise in project rescue, governance and development methodologies.

My main areas of interest are domain-driven design, event sourcing, massively-scalable service architectures and cloud computing.

I'm a regular speaker and presenter at conferences and training events. My mother wrote COBOL on punch cards and I've been coding in one form or another since I was five years old.


Cyclist. Photographer. Ballroom dancer. Motorcyclist. I love my outdoor sports - and anyone who won't dance is chicken.