Skip to content

ARC0002: Missing [Command] attribute on command-like type

The analyzer uses a heuristic: a type with a public property and an instance Handle method looks like a command. If it lacks [Command], it reports a warning. This does not mean every method named Handle belongs to Arc; rename the method if the type is not intended to be a command.

Default severity: Warning.

Compile these alternatives separately with Cratis.Arc.Core. The first deliberately produces ARC0002; these are declaration examples, not runnable hosts.

public record NormalizeName(string Name)
{
public string Handle() => Name.Trim();
}

Add the model-bound attribute:

using Cratis.Arc.Commands.ModelBound;
[Command]
public record NormalizeName(string Name)
{
public string Handle() => Name.Trim();
}

The handler returns an ordinary string response. No event-sourcing integration is needed. If the attribute is absent, Arc does not discover this as a model-bound command.