Skip to content

Orleans analyzer diagnostics

Orleans analyzers detect unsupported RPC contracts, serialization schema problems, unsafe grain execution patterns, replay hazards in durable tasks, and compatibility changes. Select a diagnostic ID for its cause, impact, remediation, code-fix behavior, and suppression guidance.

Analyzer help links use https://aka.ms/orleans/diagnostics with the diagnostic ID as a URL fragment. The single redirect can therefore remain stable while this index and the detailed pages evolve.

Place AlwaysInterleave on the grain interface — Error. [AlwaysInterleave] is applied to an implementation method.

Reference parameter modifiers are not allowed — Error. A remote interface method uses ref, out, or in.

Inherit from Grain — Removed. Current Orleans versions support POCO grain classes.

Add missing serialization attributes — Error. A generated-serializer type has an unannotated member.

Add GenerateSerializer — Info. A [Serializable] type does not opt into Orleans source-generated serialization.

Static or abstract members cannot be serialized — Error. An invalid member is assigned an Orleans serialization ID.

Use one Orleans activation constructor — Error. Constructor-selection metadata is ambiguous or invalid.

Grain interfaces cannot contain properties — Error. An Orleans remote interface declares an instance property.

Use a registered grain-call return type — Error. Orleans cannot map a remote method return type to an invokable request.

Add a stable Alias — Info. A type or RPC method uses a name-derived identity.

Rename a duplicated Alias — Error. Type or method aliases collide.

Change a duplicated serialization Id — Error. Members of one serialized type reuse a field ID.

Remove serialization identity attributes from a grain class — Error. A grain implementation is marked for data serialization.

Preserve the grain execution context — Warning. ConfigureAwait can move a continuation outside the grain scheduler.

Grain interface is not active in OrleansContracts.txt — Warning. A grain interface is missing or retired in the manifest.

Grain interface version mismatch — Warning. Source and manifest versions differ.

Grain interface member not declared — Warning. An RPC signature is absent from the manifest.

Removed grain interface is not retired — Warning. An active manifest interface no longer exists in source.

OrleansContracts.txt is missing — Info. Contract analysis is enabled without a manifest.

Duplicate grain interface declaration — Warning. The manifest repeats an interface name or identity.

Grain class is not active in OrleansContracts.txt — Warning. A grain class is missing or retired in the manifest.

Grain class identity mismatch — Warning. Source and manifest grain types differ.

Removed grain class is not retired — Warning. An active manifest grain class no longer exists in source.

Duplicate grain class declaration — Warning. The manifest repeats a grain class name or identity.

Invalid invokable base type mapping — Error. A custom grain-call return type mapping cannot generate a valid invokable request.

Grain interface member removed from source — Warning. The manifest retains an RPC signature which is absent from source.

Invalid Orleans identity — Error. An alias, grain type, or grain interface type violates the identity syntax.

Access grain state in recorded effects or after the last durable operation — Warning. Durable task code reads or changes grain state where a replay runs it again.

Produce non-deterministic values in recorded effects — Warning. Durable task code produces a clock, random, or environment value where a replay runs it again.

Await external operations in steps or after the last durable operation — Warning. Durable task code awaits a service or other external work where a replay runs it again.

Change grain state after the last external await — Warning. A step or a body’s tail changes grain state before an external await, so the change can commit without the result.

Return the outputs of a DurableTask.RunInline effect — Warning. A DurableTask.RunInline effect assigns a variable of the body, which a replay doesn’t assign.

Await, schedule, or post durable task definitions — Error. Durable task code creates a durable task definition and never runs it.

Run each durable task definition once — Warning. Durable task code runs a single-use durable task definition more than once.

Use durable operation names without ’$’ — Error. A WithId or DurableTask.RunInline name contains $, which the runtime rejects.

Give each durable operation call site its own name — Warning. Two call sites in one body name their durable operations alike, so their identifiers depend on order.

Keep durable task bodies on their scheduler — Warning. Durable task code starts threads, timers, or thread-pool work off the activation’s scheduler.

Run concurrent durable work through durable combinators — Warning. Durable task code combines durable work with a Task combinator instead of a durable combinator.

Wait with durable delays — Warning. Durable task code waits with Task.Delay or Thread.Sleep, which a replay restarts.

Filter cancellation handlers by IsTaskCancellationRequested — Warning. Durable task code catches cancellation without telling task cancellation from attempt cancellation.

Return a task from asynchronous code in durable task bodies — Warning. A durable task body contains async void code, which the body can’t observe.

Derive a signal name for each repeated wait — Info. Durable task code waits for one signal name in a loop, so every wait returns the first value.

Log through a replay-safe logger — Info. Durable task code logs through a logger which logs again on replay.

Post durable tasks from grains or durable task bodies — Warning. Code outside grains and durable task bodies posts a durable task, which throws.

Pass AttemptCancellationToken to calls in task-cancellation cleanup — Warning. Cleanup after task cancellation passes CancellationToken, which task cancellation has already canceled, so its calls end at once.

Pass constant version names and ranges — Warning. A version check computes its change name or supported range at run time.

Await, combine, or return the handles of scheduled children — Info. A durable task body schedules an attached child and never observes its handle.

Name durable operations whose position can change — Info. An unnamed durable operation runs in a loop, a condition, or after another unnamed operation, so its generated identifier can shift.

Run synchronous work with DurableTask.RunInline — Info. A DurableTask.Run step runs only synchronous work, which an effect records without a child execution.

Pass delegates which return a task for asynchronous work — Error. DurableTask.Run or DurableTask.RunInline receives an async void delegate, whose completion is recorded before its work completes.

Assign new values to grain state instead of changing them in place — Warning. Durable task code changes an object which grain state holds, and the journal records no change.

Await durable tasks instead of polling them in durable task bodies — Error. A durable task body polls a scheduled task, which throws NotSupportedException.

Continue durable task bodies on their scheduler — Error. A durable task body awaits with ConfigureAwait(false), which resumes it off its grain’s scheduler.

Run durable operations outside DurableTask.RunInline effects — Error. A DurableTask.RunInline effect starts a task or checks a version, which throws InvalidOperationException.

Detach durable grain calls — Error. Durable task code detaches a step, an async DurableTask method, or a combinator, which runs only as part of the execution which starts it.