On a library I'm working on, which is deployed as a nuget package, I want to include Microsoft.VisualStudio.Threading
so I can use AsyncEventHandlers
.
However, the package depends on Microsoft.VisualStudio.Threading.Analyzers
which contains static code analyzers. They produce a lot of warnings, some of which involve style rules that are not universally accepted.
I don't mind them in my library project, I find them helpful, however the analyzers infect all projects that reference my package. In one of my projects there were 500+ warnings telling me to add Async to the end of all async methods.
I was able to find some related issues: Some projects' dependencies contain unexplained code analyzers
...But no direct hits. Is there a way to handle this in my package in such a way that these analyzers are turned off for downstream projects that consume my nuget package, without the end-developer having to take special action?