When this page is relevant
Catch CreateScope usage in async flows so async-disposable services are cleaned up with the correct scope pattern.
Problem guide
Use this rule when background services, async handlers, or hosted-service workflows are mixing sync scopes into async disposal paths.
When this page is relevant
Catch CreateScope usage in async flows so async-disposable services are cleaned up with the correct scope pattern.
Recommended install command
dotnet add package DependencyInjection.Lifetime.Analyzers --version 2.2.2
Relevant diagnostics
DI005
`CreateScope()` used in async flows where async disposal is needed.