Problem guide

Catch Disposable Transient Service Registrations

This rule is useful when teams are diagnosing resource leaks caused by transient disposables that look harmless in reviews.

When this page is relevant

Identify transient services implementing IDisposable or IAsyncDisposable that the container will not track or dispose automatically.

Recommended install command

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

Relevant diagnostics

The rules that cover this failure mode

DI008

Disposable Transient Service

transient services implementing `IDisposable`/`IAsyncDisposable` in risky patterns.

Severity: Warning · Code fix: Yes