EventWeave 0.4.1

dotnet add package EventWeave --version 0.4.1
                    
NuGet\Install-Package EventWeave -Version 0.4.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EventWeave" Version="0.4.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EventWeave" Version="0.4.1" />
                    
Directory.Packages.props
<PackageReference Include="EventWeave" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EventWeave --version 0.4.1
                    
#r "nuget: EventWeave, 0.4.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package EventWeave@0.4.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EventWeave&version=0.4.1
                    
Install as a Cake Addin
#tool nuget:?package=EventWeave&version=0.4.1
                    
Install as a Cake Tool

EventWeave

Lightweight event aggregation for .NET. Zero dependencies. Decoupled pub/sub messaging between services.

Why

When services need to communicate without knowing about each other, you need a message bus. EventWeave provides a minimal IEventAggregator that handles subscription, publication, and cleanup — with weak references to prevent memory leaks.

No frameworks. No reflection. No magic. Just pub/sub.

Install

dotnet add package EventWeave
dotnet add package EventWeave.CommunityToolkit

Install into Unity

In Package Manager add the following git url:

https://github.com/olivegamestudio/EventWeave.git?path=/upm

Quick start

Define a message as a record:

public sealed record OrderPlacedMessage(int OrderId, decimal Total);

Subscribe:

public sealed class NotificationService
{
    public NotificationService(IEventAggregator events)
    {
        events.Subscribe<OrderPlacedMessage>(this, OnOrderPlaced);
    }

    void OnOrderPlaced(OrderPlacedMessage message)
    {
        // send notification
    }
}

Publish:

public sealed class OrderService
{
    readonly IEventAggregator _events;

    public OrderService(IEventAggregator events)
    {
        _events = events;
    }

    public void PlaceOrder(int orderId, decimal total)
    {
        // process order
        _events.Publish(new OrderPlacedMessage(orderId, total));
    }
}

Unsubscribe when done:

events.Unsubscribe(this);

Setup

Standalone (no DI)

IEventAggregator events = new EventAggregator();

Microsoft DI

services.AddSingleton<IEventAggregator, EventAggregator>();

CommunityToolkit.Mvvm adapter

If you already use IMessenger in your presentation layer and want EventWeave in your application layer:

dotnet add package EventWeave.CommunityToolkit
services.AddSingleton<IMessenger, WeakReferenceMessenger>();
services.AddSingleton<IEventAggregator, MessengerEventAggregator>();

Diagnostics

Publish automatically captures caller information for debugging:

public interface IEventAggregator
{
    void Publish<TMessage>(
        TMessage message,
        [CallerMemberName] string? caller = null,
        [CallerFilePath] string? file = null)
        where TMessage : class;
}

Packages

Package Purpose
EventWeave Core library. IEventAggregator, EventAggregator. Zero dependencies, netstandard2.0.
EventWeave.CommunityToolkit Adapter MessengerEventAggregator wrapping IMessenger from CommunityToolkit.Mvvm.

Design principles

  • Zero dependencies in the core package. Runs on .NET Framework 4.6.2, .NET 10, Unity, MonoGame — anywhere netstandard2.0 works.
  • Thread safe. Subscriptions and publications are safe to call from any thread.
  • No reflection. All wiring is explicit or source-generated.
  • Messages are records. Immutable, equatable, pattern-matchable.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on EventWeave:

Package Downloads
EventWeave.CommunityToolkit

EventWeave adapter for CommunityToolkit.Mvvm IMessenger. Bridges EventWeave with existing MVVM messaging infrastructure.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.4.1 140 4/21/2026
0.4.0 140 4/21/2026
0.3.0 136 4/21/2026
0.2.0 127 4/21/2026
0.1.0 133 4/21/2026