// AKKA.HOSTING
Akka.Hosting integrates Akka.NET directly with Microsoft.Extensions. DI, IHostedService lifecycle, structured logging, health checks, and strongly-typed configuration — all work out of the box. No boilerplate, no separate config files.
// KEY_CAPABILITIES
First-class IServiceProvider integration. Inject actors via IRequiredActor<T> and resolve services inside actors using DependencyResolver. No more service locator patterns.
Typed key registry for actor resolution via DI. Register actors during startup, resolve them anywhere in your application. Type-safe, no magic strings.
ActorSystem lifecycle automatically tied to the .NET host. Starts with your app, shuts down gracefully. Integrates with Microsoft.Extensions.Logging for OpenTelemetry compatibility.
Fluent API extends to Remote, Cluster, Persistence, and Sharding via NuGet extension packages. Organize configuration into composable Add* extension methods.
// JUST_ADD_AKKA
AddAkka() plugs into IServiceCollection just like EF Core, SignalR, or any other .NET library. Inject actors into your endpoints with IRequiredActor<T>. Read the full walkthrough →
var builder = WebApplication.CreateBuilder(args); // Add Akka.NET to your ASP.NET Core app — just like any other service builder.Services.AddAkka("MyActorSystem", configurationBuilder => { configurationBuilder .WithRemoting("localhost", 8110) .WithClustering(new ClusterOptions { Roles = ["web"] }) .WithActors((system, registry) => { var echo = system.ActorOf(Props.Create<EchoActor>()); registry.Register<Echo>(echo); // register for DI }); }); var app = builder.Build(); // Inject actors into endpoints — just like any other dependency app.MapGet("/", async (IRequiredActor<Echo> echo) => await echo.ActorRef.Ask<string>("hello")); app.Run();
// NUGET_PACKAGES
// LEARN_MORE