Skip to content

Code Analysis Rules

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

Arc.Core includes Roslyn analyzers that validate Arc constructs at compile time to catch errors early and enforce best practices.

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

Rule IDTitleSeverityDescription
ARC0001Incorrect query method signature on ReadModelErrorReadModel query methods must return the ReadModel type or an allowed wrapper of it.
ARC0002Missing [Command] attribute on command-like typeWarningCommand-like types must be marked with [Command] to be recognized as commands.
ARC0003Handle() must be on [Command] typeErrorPublic command Handle() methods must be declared on the command type itself.
ARC0004[Command] type must have public Handle() methodErrorTypes marked with [Command] must declare a public instance Handle() method.

No automatic code fixes are currently provided for these rules.

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

<ItemGroup>
<ProjectReference Include="../Arc.Core/Arc.Core.csproj" />
</ItemGroup>