Disabling certain methods for VSTHRD103? #1458
Unanswered
Matthew O'Connor (oconnor0)
asked this question in
Q&A
Replies: 1 comment 2 replies
|
This comes up now and then. We already have a data-driven VSTHRD010 analyzer, so I suppose we could offer an option for you to identify APIs that VSTHRD103 would ignore as well. I don't imagine this is going to get attention right away from us though. Would you care to volunteer a PR, following the pattern we use for VSTHRD010 for reading from AdditionalFiles? |
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I'm using the analyzer with VSTHRD103 enabled to catch misuse of synchronous methods inside async ones - as you might expect. There are however certain async methods in public APIs that, for my particular use case, I would prefer not to report. Is there a way to disable certain methods vs disabling the diagnostic at certain call sites or disabling the diagnostic altogether?
If it matters, for this particular case, I want to use SqlDataReader.Read instead of SqlDataReader.ReadAsync since it seems like the former is somewhat faster and allocates less memory.
All reactions