Skip to main content

Analyzer Diagnostics

Excalibur ships Roslyn analyzers that detect common issues at compile time. These diagnostics appear in your IDE and build output.

Diagnostic Reference

IDTitleSeverityCategory
DISP001Handler Not DiscoverableWarningHandlers
DISP002Missing AutoRegister AttributeInfoHandlers
DISP003Reflection Without AOT AnnotationWarningCompatibility
DISP004Optimization HintInfoPerformance

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>

See Also