Latest release

2.8.26

2026-05-13

Upgrade

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

Open on NuGet

Release workflow output

This page is generated from CHANGELOG.md so GitHub Releases, the docs site, and package surfaces all stay aligned on the same release narrative.

Changed

  • DI003 fixer conditional-access lifetime rewrite: The DI003 lifetime-adjustment code fix now also rewrites conditional-access registration invocations such as services?.AddSingleton<TFoo, TFooImpl>() to services?.AddScoped<TFoo, TFooImpl>() (or the appropriate replacement lifetime) when the invocation expression is a MemberBindingExpressionSyntax. Both TryRewriteServiceCollectionRegistrationInvocation and TryGetCurrentLifetime recognise the conditional-access shape so the fix is discovered and applied. The rewrite preserves the trigger's null-safe receiver.