Open Suchiman opened 6 months ago
Building up on this: In fact, I was able to write a small POC, allowing 4 out of 4 cases to detect usings in "Dispose" bans and 3 out of 4 cases to detect usings in "DisposeAsync" cases
Would really love to see this aspect of Dispose banning being covered
Analyzer
Diagnostic ID: RS0030
Describe the improvement
When you ban the Dispose method like so:
this should not just prevent calling
.Dispose();
but alsousing (httpClient)
as well asusing var client = new HttpClient()
Describe suggestions on how to achieve the rule
Expand the existing analysis to consider
using
in the analysis as an call toDispose
andawait using
toDisposeAsync