Neither of the examples on this page trigger CA2000 when using the Roslyn analyzers built into the project SDK. I am able to trigger CA2000 on other code in the same project (e.g. by not disposing a SqlConnection), but not from these examples. I initially thought that only the second example was a problem, because it uses a local StreamReader, even though the "Special Cases" section says that TextReader is excluded. However, the first example does not trigger CA2000 either.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: 80e2f8df-7039-c826-764e-88abefb6744b
Version Independent ID: f75bace0-4c3a-5936-8e19-9e2334fd9848
Neither of the examples on this page trigger CA2000 when using the Roslyn analyzers built into the project SDK. I am able to trigger CA2000 on other code in the same project (e.g. by not disposing a
SqlConnection
), but not from these examples. I initially thought that only the second example was a problem, because it uses a localStreamReader
, even though the "Special Cases" section says thatTextReader
is excluded. However, the first example does not trigger CA2000 either.Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.