Skip to content

Code analysis

This section documents the code analysis rules provided by the Chronicle code analyzer for .NET.

Chronicle includes Roslyn analyzers that validate aggregate root event handler signatures at compile time to catch errors early and enforce best practices.

All rules follow the identifier format ARCCHR#### where the numbers are sequential without gaps.

Rule IDTitleSeverityDescription
ARCCHR0001Incorrect aggregate root event handler signatureErrorAggregate root event handlers must follow allowed On method signatures.
ARCCHR0005Chronicle is used but not wired upWarningA project uses Chronicle features but sets up Arc without WithChronicle() or AddCratis().
ARCCHR0008Command key marked with the data annotations Key attributeWarningA command marks its key with an attribute Chronicle does not resolve keys from.
Rule IDQuick fix
ARCCHR0008Use the Chronicle Key attribute — rewrites the attribute to the one Chronicle resolves keys from.

The other rules have no automatic code fix.

The analyzer is automatically included when you reference Chronicle in your project. No additional configuration is required.

<ItemGroup>
<ProjectReference Include="../Chronicle/Chronicle.csproj" />
</ItemGroup>