Solved (Sorta): My Mac Thinks its in UTC Timezone

I was working on a project and was trying to convert an ISO-8601 timestamp string from my server into localtime for display. Most libraries should handle that automatically, since the js Date object is pretty much always in local time. But it kept showing me a time that was off by a few hours.

Eventually I figured out that certain systems in my environment were using UTC time, even though I live in Kansas City and it should be using America/Chicago.

Read More

Optimizing build pipelines in Azure DevOps

Build time before optimization: ~50 minutes

We have a monolith application hosted in Azure DevOps. We use the Pipelines product to run builds and tests on every pull request. After merging, the builds run again. Build times were creeping up towards an hour, leading to some pain points for our developers:

  • It’s really frustrating to feel pressure to release a hotfix, but it takes multiple hours to prep a release artifact
  • Even an insignificant code change due to PR feedback led to delaying the merge another hour
  • Developers get distracted during builds and move on to new tickets, increasing work-in-process counts and delaying merges

I wanted to get it down to under 20 minutes. Here’s how we did it.

Read More

Using Keyed Services in .NET 8

.NET 8 is going to ship Keyed Services with Microsoft.Extensions.DependencyInjection, the default IOC container. Keyed services allow developers to register multiple implementations of an interface under different names (or, more generically, “keys”). This is useful in some scenarios. Let’s take a look.

Read More

Choosing a DotNet Test Framework

I saw a Reddit post asking which test framework to use: xUnit, NUnit, or MSTest. I’ve used xUnit almost exclusively for years and don’t have firm enough experience with the others to recommend for or against them. Any bias I have against MSTest is probably years out of date. I hear it’s pretty good now!

Instead, I thought I would list my top test framework considerations.

Read More

Why AutoFac

I’ve frequently seen a question arise about why anyone would use an open-source dependency injection framework like AutoFac when Microsoft provides Microsoft.Extensions.DependencyInjection (MEDI). Isn’t that good enough?

It’s a fair question. MEDI is a capable dependency injection container and will support most application needs. However, I still find it worthwhile to plug AutoFac in.

Microsoft created MEDI so that framework and library authors could depend on some basic dependency injection capabilities without writing adapters for every popular DI container. Microsoft specified base-level functional expectations, but application developers that wanted more power could use a different tool as long as it could conform to the protocol Microsoft specified. As a result, the MEDI provides a limited feature set by design.

I frequently want more robust capabilities and will install AutoFac to get them.

The rest of this post will highlight some of the features of AutoFac that I particularly like. While not provided out of the box, Developers can emulate many of these features with MEDI, though perhaps clumsily. Some have no analog at all. Sample code is also on GitHub.

Read More

Tips for selling your technical vision

My company’s CEO once commented that Architect is a sales position. I think that is a wise observation and applies to most technical leadership roles.

It’s not enough to have good ideas: you need to sell them.

Here are some tips I’ve found that help build consensus and nudge a team in a direction I believe is best.

Read More