Skip to content

Is there a Lint Rule or Some way to indicate something implements IDisposable #78123

Discussion options

You must be logged in to vote

https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca2000

However, this rule is very unreliable. It doesn't properly track ownership transferring (storing values to fields), which is a very complex problem.

Moreover, fail to call Dispose on usual objects do not cause memory issue, because there is finalizer. It's usually a performance issue instead.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by chris-clark-serverless
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants