• TIL: Concurrent IHostedService start with .NET 8

    When using IHostedService implementations to start or run custom code as part of a generic host or web application instance, there are two major behaviors one should keep in mind:

    1. Hosted services are started in the order of registration with the DI container. This is a subtle detail for most use cases, but when there are...
  • Fun with assembly versions

    Assembly loading remains a gift that keeps on giving. In a previous blog post, I focused on the assembly-resolving logic that tries to load an assembly that isn’t already loaded but is deployed along with our application. This post focuses specifically on the type-resolving behavior when retrieving the type from an assembly already loaded but with a different version...

  • Disposing once, disposing twice, gone!

    Chances that you’ve been using a dependency injection (DI) container in a C# application are incredibly high. All DI containers I know come with a child container or scope capability, as the Microsoft DI abstraction calls it. Scopes provide a dedicated instance lifetime controlled by the user. Consider the following code:

  • OpenTelemetry tracing with AWS X-Ray

    NServiceBus version 8 will come with OpenTelemetry instrumentation to capture message processing traces and metrics and export those to any OpenTelemetry compatible tooling.

  • async/await Pitfalls: Premature Disposal

    Since the introduction of async/await, plenty of pitfalls could cause all sorts of errors and deadlocks. Often, these little mistakes were subtle and hard to detect for developers less experienced (less burned) with async/await.

  • Manging repository standards using MSBuild and NuGet

    At Particular Software, we do have quite a few repositories to maintain. When writing this, there are about ~75 public repositories (that are not archived) in our organization. Using common repository settings and style checks helps to ensure that the same coding guidelines and practices apply to every repository. But these standards also change, evolve, or need updates.

  • Console Debug

    The [CallerArgumentExpression] attribute is a new language feature introduced with C# 10. While the official documentation does little to nothing to explain what it does, others have already covered the feature itself to a large extent. I quite like Andrew Lock’s post about this feature.

  • Assembly resolving edge-cases in .NET Core

    Type.GetType is an interesting API. I reliably forget that Type.GetType can load types via its FullName[1] only from the executing assembly and from mscorlib.dll/System.Private.CoreLib.dll libraries. For types in any other assembly the API requires the assembly-qualified name. For the later case, Type.GetType will also load said assembly if...

  • Start at a suistainable pace

    I received this advice from my highly valued colleague and co-worker, Daniel Marbach. While he is a genius software engineer, he is also a gym enthusiast. Some day, I expressed my frustration about the lack of enjoyment and motivation I get from doing fitness exercises. I’ve mostly tried bodyweight training as I could do my workouts at home, but...

  • Scatter-Gather in NServiceBus, part 2

    In the previous blog post we concluded that sagas struggle to deal with scenarios where multiple messages need to update the same saga instance. Depending on the persistence option, this can manifest itself differently in practice:

    • For persistence options using pessimistic locking, the described scenario will slow down the endpoint’s throughput as the locking mechanism will only allow...
  • Scatter-Gather in NServiceBus, part 1

    This article series is about showing how to implement the Scatter-Gather pattern in NServiceBus. There are some common mistakes and hidden traps users can easily fall into, leading to bad performance and other issues.

  • The curious case of navigating GitHub repositories

    Reading a lot of markdown pages on GitHub, I’ve soon started to miss a way to navigate larger pages more easily. Of course, the obvious solution was to reinvent the wheel and create a Chrome plugin to inject a TOC (table of content) into markdown files hosted in GitHub repositories. No worries, this isn’t going to be a blog...