Skip to content
CAI
Software that uses CAICheck a score

daniellittledev/Enexure.MicroBus

52.1

Adequate · 21 September 2026

1.9k

lines of production code

C#

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a .NET library for implementing the Mediator pattern, providing a flexible message bus for handling commands, events, and queries. It supports multiple dependency injection containers, including Autofac, Microsoft.Extensions.DependencyInjection, StructureMap, and LightInject, while also offering built-in saga management for long-running processes. The architecture emphasizes extensibility through global pipelines and cancellable handlers, all managed within a modern, SDK-style project structure.

How it got here

2015 — SDK-style migration and saga support

17 changes.

The project underwent a significant architectural shift by migrating to the modern SDK-style .csproj format and .NET Core build tooling. This period also introduced comprehensive support for sagas and expanded dependency injection integration, particularly with Autofac, while refactoring the core bus API to support global pipelines and cancellation.

2017 — Dependency injection integrations

6 changes.

This period focused on expanding MicroBus's compatibility with various .NET dependency injection containers, specifically adding support for Microsoft.Extensions.DependencyInjection, LightInject, and StructureMap. Each integration was accompanied by comprehensive test suites to verify correct behavior and scope management within those containers.

Features

Add Autofac integration for MicroBus

The Enexure.MicroBus.Autofac package now provides a complete integration with the Autofac container. New classes (AutofacDependencyResolver, AutofacDependencyScope) implement the IDependencyResolver and IDependencyScope interfaces to manage Autofac lifetime scopes, ensuring that nested scopes are handled correctly without creating unnecessary new scopes. Additionally, ContainerExtensions.RegisterMicroBus registers the MicroBus, MicroMediator, pipeline builders, and all message/global handlers with Autofac, enabling users to resolve and execute bus messages through the Autofac container.

src/Enexure.MicroBus.Autofac · high confidence

Add LightInject and StructureMap integration support

Users can now integrate MicroBus with LightInject and StructureMap dependency injection containers. This change introduces new \Enexure.MicroBus.LightInject\ and \Enexure.MicroBus.StructureMap\ packages, each providing extension methods to register MicroBus services, handlers, and pipelines into their respective containers. The implementation includes specific dependency scopes and resolvers for each container, enabling scoped and transient service lifetimes within the bus architecture.

src/Enexure.MicroBus.StructureMap · high confidence

Add Microsoft Dependency Injection support for MicroBus

Users can now register and resolve MicroBus components using the standard Microsoft.Extensions.DependencyInjection container. The new \Enexure.MicroBus.MicrosoftDependencyInjection\ package provides extension methods to register the bus, handlers, and related services (such as \IMicroBus\, \IMicroMediator\, and pipeline builders) into the DI container, enabling seamless integration with .NET's built-in IoC container.

src/Enexure.MicroBus.MicrosoftDependencyInjection · high confidence

Introduce saga support with in-memory repository and finder abstractions

The Enexure.MicroBus.Sagas package now provides the core infrastructure for managing sagas, including the ISaga marker interface, an ISagaFinder abstraction for locating saga instances, and a SagaRunnerEventHandler that orchestrates saga lifecycle (creation, update, completion) based on incoming events. A new BusBuilderExtensions API allows developers to register sagas and their associated finders, while a FinderList utility simplifies the registration of multiple finders. The change also introduces specific exception types (NoSagaFinderRegisteredException, NoSagaFoundException, SagaNotFoundException) to handle common saga lookup failures, and replaces the previous ICommandFinder with the new saga-specific interfaces.

src/Enexure.MicroBus.Sagas · medium confidence

Restructured solution to support multiple DI containers and new features

The solution has been reorganized to include dedicated projects for Autofac, Microsoft.Extensions.DependencyInjection, StructureMap, and LightInject, alongside new support for Sagas and global handlers. The README has been updated to reflect these additions and provide updated usage examples.

(repo-wide) · high confidence

Behavioural changes

Added specific exception types for MicroBus validation errors

The MicroBus library now includes a dedicated set of exception classes to handle specific validation and runtime errors. New exceptions include NoRegistrationForMessageException, NullMessageTypeException, InvalidMessageTypeException, and TypeIsNotAnInterceptorException, each providing detailed context about the failed operation. Additionally, the previous IEventFinder interface has been replaced by InvalidMessageTypeException, and TypeExtensions has been replaced by TypeIsNotDelegatingHandlerException, ensuring that all error conditions are explicitly defined and easily catchable.

src/Enexure.MicroBus/Exception · high confidence

Build system migrated to .NET Core and dotnet CLI

The build process has been updated to use the full .NET Core tooling and the dotnet CLI instead of the previous MSBuild/PSake-based approach. The build script now iterates over all .csproj files to run dotnet build, dotnet test, and dotnet pack tasks, replacing the previous solution-file-based compilation and manual versioning logic.

build · medium confidence

Introduces cancellation support and new handler interfaces for the MicroBus infrastructure

The MicroBus infrastructure contracts have been expanded to support cancellation across commands, events, messages, and queries. New interfaces (ICancelableCommandHandler, ICancelableEventHandler, ICancelableMessageHandler, ICancelableQueryHandler) allow handlers to receive a CancellationToken. The core bus interfaces (IMicroBus, IMicroMediator) and their cancelable counterparts now expose cancellation parameters for SendAsync, PublishAsync, and QueryAsync operations. Additionally, a new IDelegatingHandler interface replaces the deprecated IPipelineHandler for pipeline processing, and a new ICommandHandler interface is introduced for command handling.

src/Enexure.MicroBus.InfrastructureContracts · high confidence

MSBuild invocation now targets version 14.0

The build system now explicitly targets MSBuild 14.0 when locating the executable, ensuring consistent build behavior across environments by pinning the version used for compilation tasks.

build/modules/msbuild · high confidence

Redesigned MicroBus around an internal mediator with global pipeline support

The library has been refactored to use an internal mediator pattern, introducing new classes such as MicroBus, MicroMediator, and PipelineBuilder to handle command, event, and query routing. This change introduces support for global pipelines and delegating handlers, allowing for more flexible message processing and synchronization control. Users will now interact with a redesigned API that supports cancellation tokens and improved handler resolution.

src/Enexure.MicroBus/Implementation · medium confidence

Refactor message contract interfaces in Enexure.MicroBus

The message contract interfaces (IMessage, ICommand, IEvent, IQuery, IResult) have been moved from the Enexure.MicroBus.MessageContracts namespace to the Enexure.MicroBus namespace. Additionally, the IQuery interface has been updated to use generic type parameters (IQuery\<TQuery, TResult\>) with in/out variance, and the IResult interface has been marked as obsolete. These changes alter the namespace structure and interface definitions for message handling.

src/Enexure.MicroBus.MessageContracts · medium confidence

Refactored bus builder API and handler registration model

The MicroBus library has been refactored to support a more robust and generic pipeline architecture. The \BusBuilder\ API now provides specific methods for registering command, event, and query handlers, including support for cancelable handlers and global pipeline handlers. The internal registration model has shifted from \CommandRegistration\ to a more generic \HandlerRegistration\ and \GlobalHandlerRegistration\ classes, allowing for better type safety and dependency injection integration. Additionally, the \Pipeline\ class has been redesigned to explicitly separate delegating handler types from core handler types, and the \IBus\ interface has been removed in favor of a new \IDependencyResolver\ and \IDependencyScope\ for managing lifecycles and service resolution.

src/Enexure.MicroBus · high confidence

Removed legacy assembly metadata and configuration files

The \App.config\ files and \Properties/AssemblyInfo.cs\ files for the \Sample.Autofac\ and \Sample.NoDependancyInjection\ projects have been removed. This eliminates redundant assembly metadata and .NET Framework versioning configurations that are typically managed by modern project systems, simplifying the project structure.

src/Sample.Autofac, src/Sample.NoDependancyInjection · high confidence

Removed legacy assembly metadata and migrated versioning configuration

The legacy AssemblyInfo.cs file containing assembly metadata (title, description, versioning) has been removed, reflecting a shift away from traditional .NET assembly attributes. Additionally, the project's versioning configuration has been migrated from a custom Version.json file to the standard launchSettings.json file, which now contains an empty profiles object.

src/Enexure.MicroBus/Properties · high confidence

Removed obsolete repositories.config file

The repositories.config file, which previously referenced packages.config files for Ninject and Autofac projects, has been removed from the packages directory.

packages · high confidence

Removed psake build scripts and tests

All example scripts and unit test specifications for the psake build automation module have been deleted from the repository. This removal eliminates the ability to run or verify psake-based build tasks, as the associated test suite and example configurations are no longer present.

build/modules/psake · high confidence

Test coverage

Add StructureMap integration tests for MicroBus; Added comprehensive test coverage for Autofac integration; Added comprehensive test coverage for MicroBus pipeline and handler registration; Added tests for MicroBus saga integration and baseline; Added unit tests for LightInject integration; Added unit tests for MicroBus integration with Microsoft Dependency Injection.

Dependencies

Migrate MicroBus projects to SDK-style .csproj format

The project files for MicroBus and its extensions (Autofac, LightInject, Microsoft Dependency Injection, StructureMap, and Sagas) have been converted from the legacy MSBuild XML format to the modern SDK-style csproj format. This change simplifies the build configuration, enables multi-targeting (e.g., net451, netstandard1.1, netcoreapp2.0/2.1), and integrates standard .NET tooling features like nullable reference types and C\# 8.0 language version. Additionally, sample projects (Sample.Autofac, Sample.NoDependancyInjection) have been removed, and test projects have been updated to use xunit and FluentAssertions.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 53 → 52 (-1.3)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 94 → 92 (-2.9)
  • Architecture 100 → 100 (+0.0)
  • Maturity 45 → 45 (+0.0)
  • Readiness 46 → 46 (+0.2)
  • Security 81 → 65 (-16.0)
  • Performance 60 → 60 (+0.0)

Resolved (15)

  • Bounded contexts not declared
  • High CVE: Microsoft.NETCore.App 2.1.0
  • High CVE: Microsoft.NETCore.App 2.1.0
  • High CVE: Microsoft.NETCore.App 2.1.0
  • High CVE: Microsoft.NETCore.App 2.1.0
  • Medium CVE: Microsoft.NETCore.App 2.1.0
  • Medium CVE: Microsoft.NETCore.App 2.1.0
  • Medium CVE: Microsoft.NETCore.App 2.1.0
  • Medium CVE: Microsoft.NETCore.App 2.1.0
  • No exposed public API
  • Test runner surfaced no tests
  • XML-doc coverage: Enexure.MicroBus.Sagas.Autofac(net451) (src/Enexure.MicroBus.Sagas.Autofac/Enexure.MicroBus.Sagas.Autofac.csproj)
  • dormant codebase — no living knowledge left to concentrate
  • misleading comment (src/Enexure.MicroBus.Sagas/SagaRunnerEventHandler.cs)
  • redundant comment (src/Enexure.MicroBus.LightInject/ContainerExtensions.cs)

New (35)

  • Documentation: no architecture or design documentation (README.md)
  • Duplicated block (8 lines × 2) (src/Enexure.MicroBus/Implementation/MicroBus.cs)
  • End-of-life runtime: .NET netcoreapp2.0
  • End-of-life runtime: .NET netcoreapp2.1
  • High CVE: Microsoft.NETCore.App 2.1.0
  • No SBOM
  • No artifact signing
  • No assertions: InTheDefaultAutofacScopeCommandHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.Autofac.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultAutofacScopeEventHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.Autofac.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultAutofacScopeQueryHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.Autofac.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultLightInjectScopeCommandHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.LightInject.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultLightInjectScopeEventHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.LightInject.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultLightInjectScopeQueryHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.LightInject.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultMicrosoftDependencyInjectionScopeCommandHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.MicrosoftDependencyInjection.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultMicrosoftDependencyInjectionScopeEventHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.MicrosoftDependencyInjection.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultMicrosoftDependencyInjectionScopeQueryHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.MicrosoftDependencyInjection.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultStructureMapScopeCommandHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.StructureMap.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultStructureMapScopeEventHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.StructureMap.Tests/ScopesAndDisposeTests.cs)
  • No assertions: InTheDefaultStructureMapScopeQueryHandlersShouldFinishBeforeTheScopeIsDisposed (src/Enexure.MicroBus.StructureMap.Tests/ScopesAndDisposeTests.cs)
  • No assertions: SagaWithTwoStarters (src/Enexure.MicroBus.Saga.Autofac.Tests/CompleteSagaTests.cs)
  • …and 15 more

Architecture

  • Containers 0 added · 0 removed · contexts 1 added · 0 removed · edges 0 added · 0 removed

Added bounded contexts (1)

  • Enexure.MicroBus

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

daniellittledev/Enexure.MicroBus was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 9ef8ddfbb3e1fb6d8ff2e053a6521dd10ce3a467 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.