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
DISP005Handler Should Be SealedWarningHandlers
DISP006Message Type Missing Dispatch InterfaceWarningHandlers

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###.

IDTitleSeverityCategory
EXMIG0001MediatR registration is portableInfoMigration
EXMIG0002Construct requires a manual migration stepInfoMigration
EXMIG0003using MediatR; directive is swappableInfoMigration
EXMIG0004Handler signature differs from compat shapeWarningMigration

Compliance Diagnostics (EXCMP)​

Excalibur.Compliance.Abstractions ships diagnostics for field-encryption annotations the framework cannot honour. They report, at build time, the same problems the framework would refuse at run time — and one it would never notice at all (EXCMP003). They arrive with the package; there is nothing extra to install.

IDTitleSeverityCategory
EXCMP001Annotation on a type that cannot carry ciphertextWarningEncryption
EXCMP002Annotation on a property without a getter and a setterWarningEncryption
EXCMP003Annotation on a property the framework never inspectsWarningEncryption
EXCMP004Erasable personal data encrypted under a surviving purposeWarningEncryption

Installation​

The analyzers are included automatically when you reference Excalibur.Dispatch:

dotnet add package Excalibur.Dispatch

Or use the combined source generators package which includes analyzers:

dotnet add package Excalibur.Dispatch

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​