Skip to content

ASP.NET Core Integration

The Arc provides enhanced capabilities for ASP.NET Core applications, building upon the core Arc features with web-specific functionality. Install Cratis.Arc for this host (Cratis.Arc.Core alone is the lightweight alternative). Register with WebApplicationBuilder.AddCratisArc() and activate with WebApplication.UseCratisArc(). No event store is required. OpenAPI/Swagger have separate optional packages.

  • Configuration - Configure Arc through appsettings.json or programmatically
  • Authorization - Arc role checks versus separately configured ASP.NET endpoint policies
  • Microsoft Identity - Integration with Microsoft Client Principal for Azure services
  • FromRequest Attribute - Advanced model binding combining multiple HTTP request sources
  • Swagger - Enhanced OpenAPI documentation with Arc-specific schema generation
  • Validation - Comprehensive validation with FluentValidation support
  • Without Wrappers - Control response wrapping behavior for specific endpoints
  • Invariant Culture - Configure invariant culture defaults and understand request-level overrides

Use the ASP.NET Core integration when you need:

  • Full web framework capabilities (Kestrel, middleware pipeline, static files)
  • Razor views or MVC features
  • Swagger UI for API documentation
  • Advanced middleware scenarios
  • Kestrel’s HTTP server capabilities
  • Traditional web application patterns

Consider using Arc.Core (without ASP.NET Core) when you need:

  • Minimal dependencies and smaller binary size
  • A simplified HttpListener host rather than the ASP.NET middleware ecosystem
  • A deployment whose performance and Native AOT compatibility you verify with your actual dependencies
  • Console applications or background services
  • Scenarios where full web framework is unnecessary