Configure a host
A Troolio host composes Microsoft Orleans with the actor assembly, event store, serializer, and application services. The basic TroolioServer overload shown here is a starting point for local evaluation with Troolio.Core 10.0.8.
On this page
Register actors and storage
using Microsoft.Extensions.Hosting;
using Troolio.Core;
using Troolio.Core.Serialization;
using Troolio.Stores;
namespace MyApp;
public static class CounterHost
{
public static IHost Build() => Host.CreateDefaultBuilder()
.TroolioServer<InMemoryStore, JsonEventSerializer>(
appName: "Counter",
registerAssemblies: [typeof(CounterActor).Assembly],
configureDelegates: _ => { },
builderDelegates: null,
disableActors: null);
}
registerAssemblies tells the host where to discover actor and projection types. The generic parameters choose an IStore and an IEventSerializer. configureDelegates is where the application registers its own services. TroolioServer builds an IHost; the caller still starts and stops it according to the application's lifetime.
Choose a real deployment profile
The basic overload retains the bundled Local/Azure profile. An overload with configureClustering gives the application control over Orleans membership, endpoints, storage, reminders, and streams. When you use that callback, supply all required Orleans services for your deployment. This callback does not replace the domain event store or historical replay.
The in-memory store does not survive process exit. For persistent operation, choose a compatible adapter and review its schema, credentials, transaction contract, projection workers, and recovery path. See SQL Server, KurrentDB, and the combined integration.
Serving contract
A host must provide current caller authentication and command authorization, trusted source and owner observations where needed, route authority, provider idempotency, retention windows, and recovery operations. A package reference or successful silo startup does not establish serving readiness. Use the deployment checklist to review these pieces together.