Repository navigation
Document service resolution thread safety and lifetime concurrency guidelines (Fixes #47086) - #56682
Open
Manish-1kumar wants to merge 2 commits into
Conversation
Manish-1kumar
force-pushed
the
users/manish/issue-47086-di-service-resolution-thread-safety
branch
from
November 30, 2026 17:40
09df433 to
d370f47
Compare
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The article’s ms.date remains 10/21/2025 and needs updating to reflect the substantive content refresh.
1 open issue
What changed in this PR
Addresses #47086 by documenting thread-safe service resolution and lifetime-specific concurrency expectations in the .NET dependency injection guidance.
Changes:
- Distinguishes container resolution safety from service-instance thread safety.
- Adds links to related guidelines and the dependency injection overview.
| File | Description |
|---|---|
docs/core/extensions/dependency-injection/service-lifetimes.md |
Adds thread-safety guidance and related links. |
Review effort: Balanced
|
|
||
| In apps that process requests, singleton services are disposed when the <xref:Microsoft.Extensions.DependencyInjection.ServiceProvider> is disposed on application shutdown. Because memory isn't released until the app shuts down, consider memory use with a singleton service. | ||
|
|
||
| ## Thread safety considerations |
Contributor
Author
There was a problem hiding this comment.
I have updated ms.date to 12/03/2026 in 4750c39.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Addresses issue #47086 by adding clear thread safety documentation to
docs/core/extensions/dependency-injection/service-lifetimes.md:## Thread safety considerationssection.IServiceProvider) or active scope (IServiceScope) is thread-safe across concurrent threads.guidelines.md#thread-safetyand added## See alsolinks.Fixes #47086.
Internal previews
Build report