EricksonLopez.Events
dotnet-events · Messaging & Events
On this page (20 sections)
1. Identity, Tier & Maturity Profile#
2. Value Proposition & Problem Solved#
Event contracts and primitives for building decoupled, event-driven .NET applications, designed for trimming and Native AOT
Reflection-heavy mediator and event-bus libraries allocate heap delegates and header dictionaries on every dispatch, introducing GC pressure and breaking trimming.
3. Quick Install#
Primary package: EricksonLopez.Events
dotnet add package EricksonLopez.Events --version 2.0.0<PackageReference Include="EricksonLopez.Events" Version="2.0.0" /><PackageVersion Include="EricksonLopez.Events" Version="2.0.0" />4. Verified Ecosystem Metrics#
Snapshot retrieved UTC: 2026-12-01
5. When to Use & When Not to Use#
When to use
- You need L0 domain/integration event contracts (IDomainEvent, EventEnvelope<TEvent>) and in-process ValueTask dispatching.
- You want RFC 9562 monotonic EventId values and CNCF CloudEvents v1.0 JSON serialization.
When NOT to use
- You need durable broker delivery across process restarts—pair with EricksonLopez.Outbox or EricksonLopez.Messaging.
6. Core Capabilities & Design Invariants#
ValueTask In-Process Dispatch
Supports SequentialExecutionStrategy and ParallelExecutionStrategy with FailFast or AggregateAndContinue error policies.
Structured EventEnvelope & CloudEvents
Carries correlation, causation, tenant identity, and bidirectional CloudEvents v1.0 conversion.
OpenTelemetry & Source-Generated Metadata
Provides EventBusDiagnostics instrumentation and trimming-safe handler discovery.
7. Included NuGet Packages & Adapters#
| Package ID | Status | NuGet / Local | TFMs | AOT Status | Downloads | Description |
|---|---|---|---|---|---|---|
| EricksonLopez.EventsPrimary | Published | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 398 | Event dispatching, bus orchestration and ambient pipeline primitives for decoupled, event-driven .NET applications, designed for trimming and Native AOT. |
| EricksonLopez.Events.Contracts | Published | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 4,095 | Pure domain-level event contracts and identifiers for decoupled, event-driven .NET applications. Zero third-party dependencies. |
| EricksonLopez.Events.Testing | Published | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 428 | Testing utilities and fake event publishers/handlers for EricksonLopez.Events. |
| EricksonLopez.Events.Serialization.SystemTextJson | Published | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 298 | System.Text.Json Native AOT converters and serialization adapters for EricksonLopez.Events. |
| EricksonLopez.Events.CloudEvents | Published | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 291 | CloudEvents 1.0 adapter and bidirectional mapping extensions for EricksonLopez.Events, supporting CNCF standard event gateways and Native AOT. |
| EricksonLopez.Events.OpenTelemetry | Published | v2.0.0 / v2.0.0 | net8.0, net9.0, net10.0 | AOT: Full | 273 | OpenTelemetry instrumentation extensions for EricksonLopez.Events. Enables distributed tracing and metrics integration with OpenTelemetry .NET SDK. |
| EricksonLopez.Events.GeneratorsAnalyzer / Generator | Published | v2.0.0 / v2.0.0 | netstandard2.0 | AOT: N/A (Analyzer/Legacy) | 268 | Roslyn Incremental Source Generator for EricksonLopez.Events to generate zero-reflection compile-time event registries and descriptors. |
8. Quick Start Code Example#
Grounded in verified public APIs from EricksonLopez.Events. Compile with `<ImplicitUsings>disable</ImplicitUsings>` and explicit imports.
using System;
using EricksonLopez.Events.Contracts;
using EricksonLopez.Events.Identifiers;
public sealed record OrderPlacedDomainEvent(
EventId Id,
Guid OrderId,
Guid CustomerId,
decimal TotalAmount,
string Currency,
DateTimeOffset OccurredAt) : IDomainEvent;9. Architecture & Dependency Flow#
Rendering diagram…
flowchart LR lib_events["EricksonLopez.Events (L0)"] lib_shared_kernel["EricksonLopez.SharedKernel (L1)"] lib_shared_kernel --> lib_events lib_messaging["EricksonLopez.Messaging (L3)"] lib_messaging --> lib_events lib_outbox["EricksonLopez.Outbox (L3)"] lib_outbox --> lib_events lib_processes["EricksonLopez.Processes (L4)"] lib_processes --> lib_events
View accessible text summary and structure
0 upstream library dependencies and 4 downstream dependent libraries verified in dependencies.json.
| Direction | Library | Tier | Relationship Kinds |
|---|---|---|---|
| Downstream | EricksonLopez.SharedKernel | L1 | Compile-Time, NuGet Package |
| Downstream | EricksonLopez.Messaging | L3 | Compile-Time, NuGet Package |
| Downstream | EricksonLopez.Outbox | L3 | Compile-Time, NuGet Package |
| Downstream | EricksonLopez.Processes | L4 | Compile-Time, NuGet Package |
flowchart LR
lib_events["EricksonLopez.Events (L0)"]
lib_shared_kernel["EricksonLopez.SharedKernel (L1)"]
lib_shared_kernel --> lib_events
lib_messaging["EricksonLopez.Messaging (L3)"]
lib_messaging --> lib_events
lib_outbox["EricksonLopez.Outbox (L3)"]
lib_outbox --> lib_events
lib_processes["EricksonLopez.Processes (L4)"]
lib_processes --> lib_events10. Target Frameworks & Native AOT / Trimming Matrix#
MSBuild `.csproj` inspection across 7 packages: 6 Full, 0 Partial, 0 Incompatible, 1 NotApplicable (analyzers/generators).
| Package ID | IsAotCompatible | EnableTrimAnalyzer | Verified AOT Status | Target Frameworks |
|---|---|---|---|---|
| EricksonLopez.Events | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.Contracts | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.Testing | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.Serialization.SystemTextJson | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.CloudEvents | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.OpenTelemetry | true | true | Full | net8.0, net9.0, net10.0 |
| EricksonLopez.Events.Generators | null | null | NotApplicable | netstandard2.0 |
11. Upstream Dependencies & Downstream Dependents#
Upstream Dependencies (0)
Zero cross-family upstream library dependencies (foundational node).
Downstream Dependents (4)
12. Optional Adapters & Third-Party Integrations#
Internal Adapter Edges & Integration Packages
No optional cross-family adapter edges or integration packages are recorded for this library.
Verified External NuGet Dependencies (3)
13. Configuration & DI Registration Summary#
Verified DI & Configuration Entry Points
EventBusServiceCollectionExtensions.AddEnvelopeEventHandler<TEvent, THandler>Registers a strongly typed envelope event handler into the service collection and handler registry.
EventBusServiceCollectionExtensions.AddEventBusRegisters core event bus services into the specified service collection.
EventBusServiceCollectionExtensions.AddEventHandler<TEvent, THandler>Registers a strongly typed event handler into the service collection and handler registry.
EventBusServiceCollectionExtensions.AddEventMiddleware<TMiddleware>Registers an event middleware into the pipeline with the specified lifetime.
CloudEventsJsonSerializerOptionsExtensions.ConfigureForCloudEventsConfigures `JsonSerializerOptions` with CloudEvents v1.0 standard settings.
EventsOpenTelemetryExtensions.AddEventsInstrumentationAdds event metrics instrumentation to the meter provider.
EventsJsonSerializerOptionsExtensions.AddEventsConvertersAdds Native AOT compatible event serialization converters to the options instance.
Key Public Types & Contracts
EricksonLopez.Events.Attributes.EventNameAttribute (class)Specifies the explicit, transport-stable semantic name for an event type.
EricksonLopez.Events.Attributes.EventSourceAttribute (class)Specifies the originating producer source or URI for an event or all events in an assembly.
EricksonLopez.Events.Attributes.EventVersionAttribute (class)Specifies the explicit schema version of an event contract.
EricksonLopez.Events.Bus.EventBus (class)Provides an in-process event bus for dispatching events to registered handlers through a configurable middleware pipeline.
EricksonLopez.Events.Bus.Configuration.ErrorHandlingPolicy (enum)Specifies how exceptions arising from individual event handlers are managed during dispatch.
EricksonLopez.Events.Bus.Configuration.EventBusOptions (class)Provides configuration options for the in-process event bus.
EricksonLopez.Events.Bus.Configuration.EventExecutionMode (enum)Specifies how multiple handlers registered for the same event type are executed during dispatch.
EricksonLopez.Events.Bus.Configuration.HandlerScopePolicy (enum)Specifies the service provider scoping policy when resolving event handlers.
EricksonLopez.Events.Bus.Diagnostics.EventBusDiagnostics (class)Provides OpenTelemetry ActivitySource and Metrics instruments for the EventBus.
EricksonLopez.Events.Bus.Exceptions.EventDispatchException (class)Represents errors that occur when one or more event handlers fail during event dispatch.
EricksonLopez.Events.Bus.Execution.IExecutionStrategy (interface)Defines a strategy for executing event handlers during dispatch.
EricksonLopez.Events.Bus.Execution.ParallelExecutionStrategy (class)Executes all registered handlers for an event concurrently, collecting and aggregating any handler exceptions into a single `EventDispatchException`, or failing fast if configured.
14. Verified Performance Benchmarks#
All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).
| Suite | Method | Runtime | Mean (ns) | Allocated (B) | Status |
|---|---|---|---|---|---|
| RegistryBenchmarks | Registry_TryGetDescriptor_ByType_N1 | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 1.808 | 0 | measured |
| RegistryBenchmarks | Registry_TryGetDescriptor_ByType_N10 | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 1.855 | 0 | measured |
| RegistryBenchmarks | Registry_TryGetDescriptor_ByType_N100 | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 2.088 | 0 | measured |
| RegistryBenchmarks | StaticRegistry_GetDescriptor_Cached | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 6.251 | 0 | measured |
| RegistryBenchmarks | Registry_TryGetDescriptor_ByEventType_N100 | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 14.939 | 0 | measured |
| EventBenchmarks | Envelope_Create | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 26.02 | 80 | measured |
| DispatchScenariosBenchmarks | Publish_1Handler | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 205.7 | 624 | measured |
| EventBusBenchmarks | EventBus_Sequential_1Handler | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 275.4 | 840 | measured |
| DispatchScenariosBenchmarks | Publish_5Handlers | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 358.5 | 624 | measured |
| DispatchScenariosBenchmarks | Publish_10Handlers | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 589.8 | 624 | measured |
| DispatchScenariosBenchmarks | Publish_50Handlers | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 2,353.4 | 624 | measured |
| DispatchScenariosBenchmarks | Publish_100Events_Sequential | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 34,160.3 | 62,401 | measured |
| DispatchScenariosBenchmarks | Publish_1000Events_Sequential | .NET 10.0.1 X64 RyuJIT x86-64-v3 | 358,108 | 624,013 | measured |
15. Release History & NuGet vs Repo Status#
NuGet and repository versions are aligned.
| Version | Source | Published Date | Summary |
|---|---|---|---|
| v2.0.0 ↗ | github | 2026-09-20 | [2.0.0](https://github.com/ericksonlopezf/dotnet-events/compare/v1.0.0...v2.0.0) (2026-09-20) ⚠ BREAKING CHANGES * introduce event envelopes, execution context and versioned event infrastructure ✨ Features * introduce event envelopes, execution context and versioned event infrastructure ([30b20bc](https://github.com/ericksonlopezf/dotnet-events/commit/30b20bcfec2f7c13ef06b19555a9a8b455701f73)) |
| v2.0.0 ↗ | nuget | 2026-09-20 | Published EricksonLopez.Events 2.0.0 to NuGet.org. |
| v1.0.0 ↗ | github | 2026-08-25 | Ecosystem Packages in this release | Package | Version | |---------|---------| | `EricksonLopez.Events` | `1.0.0` | | `EricksonLopez.Events.Contracts` | `1.0.0` | | `EricksonLopez.Events.CloudEvents` | `1.0.0` | | `EricksonLopez.Events.Generators` | `1.0.0` | | `EricksonLopez.Events.OpenTelemetry` | `1.0.0` | | `EricksonLopez.Events.Serialization.SystemTextJson` | `1.0.0` | | `EricksonLopez.Eve... |
| v1.0.0 ↗ | nuget | 2026-08-25 | Published EricksonLopez.Events 1.0.0 to NuGet.org. |
16. Complementary & Related Libraries#
Libraries in the same tier, architectural layer, or directly paired via dependency edges.
17. Documentation, API Reference & Portal Links#
Conceptual Documentation (Starlight) →
Extracted XML API Reference →
26 namespaces · 77 types · 381 members
Ecosystem Dependency Map →
Learning Center & Handbook →
Per-library conceptual Starlight pages expand in M4; API Reference pages expand in M3.2.
18. Source Repository, License & Contributing#
Released under the MIT License. All assemblies follow EricksonLopez.* build invariants: explicit imports, strong-name signing (`EricksonLopez.snk`), and ASCII author metadata (`Erickson Lopez`).
19. Troubleshooting, Pitfalls & Migration Guidance#
- Register EventBus via AddEventBus() and explicit AddEventHandler<TEvent, THandler>() calls for deterministic Native AOT behavior.
20. Quality & Verification Evidence#
- Strong-Name Signing (`EricksonLopez.snk`)
- EricksonLopez.snk
- `ImplicitUsings=disable`
- disable
- XML Documentation Extraction
- Verified (26 namespaces, 77 types, 381 members)
- MSBuild AOT / Trim Attributes
- 6 Full / 0 Partial / 0 Incompatible / 1 N/A
- BenchmarkDotNet Artifacts
- 13 total (13 measured, 0 na_error)
Explicit Verification Boundaries & Limitations
- All verified measurements below come strictly from `BenchmarkDotNet.Artifacts` running on .NET RyuJIT (0 NativeAOT benchmark runs exist in this snapshot).