Analyzer Diagnostics
Excalibur ships Roslyn analyzers that detect common issues at compile time. These diagnostics appear in your IDE and build output.
Diagnostic Reference
| ID | Title | Severity | Category |
|---|---|---|---|
| DISP001 | Handler Not Discoverable | Warning | Handlers |
| DISP002 | Missing AutoRegister Attribute | Info | Handlers |
| DISP003 | Reflection Without AOT Annotation | Warning | Compatibility |
| DISP004 | Optimization Hint | Info | Performance |
| DISP005 | Handler Should Be Sealed | Warning | Handlers |
| DISP006 | Message Type Missing Dispatch Interface | Warning | Handlers |
Migration Diagnostics (EXMIG)
The Excalibur.Dispatch.Migration.Analyzers / Excalibur.Dispatch.Migration.CodeFixes packages ship
migration-tooling diagnostics that detect MediatR constructs and offer mechanical code-fixes when
porting to the Excalibur.Dispatch.Compat.MediatR
shim. The EXMIG#### range does not overlap with DISP###.
| ID | Title | Severity | Category |
|---|---|---|---|
| EXMIG0001 | MediatR registration is portable | Info | Migration |
| EXMIG0002 | Construct requires a manual migration step | Info | Migration |
| EXMIG0003 | using MediatR; directive is swappable | Info | Migration |
| EXMIG0004 | Handler signature differs from compat shape | Warning | Migration |
Installation
The analyzers are included automatically when you reference Excalibur.Dispatch.SourceGenerators.Analyzers:
dotnet add package Excalibur.Dispatch.SourceGenerators.Analyzers
Or use the combined source generators package which includes analyzers:
dotnet add package Excalibur.Dispatch.SourceGenerators
Suppressing Diagnostics
To suppress a specific diagnostic, use a #pragma directive:
#pragma warning disable DISP001
// Your code here
#pragma warning restore DISP001
Or suppress project-wide in your .csproj:
<PropertyGroup>
<NoWarn>$(NoWarn);DISP001</NoWarn>
</PropertyGroup>