Problem guide

Catch Unable To Resolve Service For Type Failures Earlier

These diagnostics focus on missing registrations, factory paths, keyed lookups, and incompatible implementation types.

When this page is relevant

Find missing registrations and implementation mismatches at compile time instead of learning about them from runtime activation exceptions.

Recommended install command

dotnet add package DependencyInjection.Lifetime.Analyzers --version 2.2.2

Relevant diagnostics

The rules that cover this failure mode

DI015

Unresolvable Dependency

registered services with direct or transitive constructor/factory dependencies that are not registered (including keyed and open-generic paths).

Severity: Warning · Code fix: Yes

DI013

Implementation Type Mismatch

invalid `typeof` service/implementation pairs that compile but fail at runtime.

Severity: Error · Code fix: No