Skip to main content

MP0026

Injects a module into a module constructor; declare DependsOn and use context.GetModule or context.GetModuleIfRegistered.

PropertyValue
CategoryUsage
Default severityWarning
AvailabilityPublic analyzer package

Configure severity​

.editorconfig
dotnet_diagnostic.MP0026.severity = warning

Use none to disable the rule, or silent, suggestion, warning, or error to change its severity.

Suppress a specific occurrence​

#pragma warning disable MP0026
// Code that intentionally violates MP0026.
#pragma warning restore MP0026