MP0021
Optional dependency accessed with GetModule instead of GetModuleIfRegistered.
| Property | Value |
|---|---|
| Category | Usage |
| Default severity | Warning |
| Availability | Public analyzer package |
Configure severity
.editorconfig
dotnet_diagnostic.MP0021.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 MP0021
// Code that intentionally violates MP0021.
#pragma warning restore MP0021