Skip to content

Cratis Arc C# host selection

Cratis Arc offers two C# HTTP hosts: ASP.NET Core through Cratis.Arc, or a lightweight HttpListener host through Cratis.Arc.Core. Choose the host before following a setup guide: both use Arc.Core’s command and query model, but their startup code is different. Persistence and TypeScript proxy generation are separate choices; neither host requires Cratis Chronicle.

Host Package and bootstrap Use it when…
ASP.NET Core Cratis.Arc, WebApplication.CreateBuilder(args), builder.AddCratisArc(), app.UseCratisArc() You want ASP.NET Core routing, middleware, controllers alongside model-bound endpoints, and its authentication ecosystem
Lightweight host Cratis.Arc.Core, ArcApplication.CreateBuilder(args) You want a small HTTP service using .NET’s HttpListener, without ASP.NET Core middleware or controllers

For an ASP.NET Core application, start with the standalone getting-started path. If you choose the lightweight host, follow the Arc.Core getting-started guide instead. Use the complete startup example for your chosen host: the builders and extension methods are host-specific.

depends on

uses

chooses

or chooses

Cratis.Arc ASP.NET Core integration

Arc.Core application model

ArcApplication lightweight host

Application

Using Arc.Core without ASP.NET Core does not establish compatibility with every device, desktop, browser, ahead-of-time (AOT) compilation target, or restricted runtime. Check the selected host and dependencies on your deployment target before choosing it.

Once you have chosen a host, decide how each command saves changes. Commands may call application services, write MongoDB collections, or use EF Core contexts. Add Chronicle explicitly when a feature needs event persistence, projections that build read models from events, or reactors that respond to events. Returning an event-shaped object from standalone Core is ordinary response handling, not an automatic append to an event log.

If you want generated TypeScript clients, configure proxy generation after choosing the host. The generator is a separate post-build tool: install its build package and configure an output path. It inspects compiled assemblies and uses PDB debug information for source-file grouping, so the backend does not need to be running. Generate in Debug before type-checking the frontend.