Add Analyzer to warn about implement IDisposable on types registered into your services
- Dominant language
- C#
- Stars
- 23.3k
- Forks
- 2k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 296
Description
### Description
We've seen a number of issues where users will register transient types into the Service Provider but then they implement IDisposable on those types.
When you do this, the service provider is going to hold a reference to these types forever
https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection-guidelines#example-anti-patterns
Contributor guide
Research direction
No source files or tests are named in the issue. Start by locating the repository's analyzer infrastructure and read the linked dependency-injection guidance; done means a diagnostic warns when a transient service registration involves a type implementing IDisposable, with coverage for the relevant registration cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100