Akka.Hosting.Maui 1.5.8

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Akka.Hosting.Maui --version 1.5.8
NuGet\Install-Package Akka.Hosting.Maui -Version 1.5.8
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="Akka.Hosting.Maui" Version="1.5.8" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Akka.Hosting.Maui --version 1.5.8
#r "nuget: Akka.Hosting.Maui, 1.5.8"
#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.
// Install Akka.Hosting.Maui as a Cake Addin
#addin nuget:?package=Akka.Hosting.Maui&version=1.5.8

// Install Akka.Hosting.Maui as a Cake Tool
#tool nuget:?package=Akka.Hosting.Maui&version=1.5.8

Akka.Hosting.Maui

HOCON-less configuration, application lifecycle management, ActorSystem startup, and actor instantiation for Akka.NET. This is an Akka.Hosting adapter for .NET Maui applications.

The reason this exists in the first place is because Microsoft.Extensions.Hosting aren't supported on .NET Maui and there are no plans to support it. We've adapted Akka.Hosting to run using a Maui IMauiInitializeService instead an IHostedService behind the scenes - and this should make it trivially easy to use Akka.Hosting's 'ActorRegistry' to inject actors into your UI elements and background services.

Installation

First, you need to install the Akka.Hosting.Maui package into your Maui application:

dotnet add package Akka.Hosting.Maui

Next, inside your MauiProgram.cs (or equivalent) call the AddAkkaMaui method:

using Akka.Hosting.Maui;
using Akka.Hosting.MauiSample;
using Microsoft.Extensions.Logging;

namespace Akka.Hosting.MauiDemo;

public static class MauiProgram
{
    public static MauiApp CreateMauiApp()
    {
        var builder = MauiApp.CreateBuilder();
        builder
            .UseMauiApp<App>()
            .ConfigureFonts(fonts =>
            {
                fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
                fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
            });

#if DEBUG
        builder.Logging.AddDebug();
#endif
        
        builder.Services
            .AddAkkaMaui("TestSys", config =>
            {
                config.WithActors((system, registry) =>
                {
                    var echo = system.ActorOf(ClickActor.Props);
                    registry.Register<ClickActor>(echo);
                });
            })
            .AddTransient<MainPage>();

        return builder.Build();
    }
}

And from there, you should be able to use any of the other Akka.Hosting methods to configure your ActorSystem and your actors!

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-android31.0 is compatible.  net6.0-ios was computed.  net6.0-ios16.1 is compatible.  net6.0-maccatalyst was computed.  net6.0-maccatalyst16.1 is compatible.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net6.0-windows10.0.19041 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.5.8 318 7/6/2023
1.5.6.1 232 5/18/2023

• Fixed bugs