Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

How can I reference a nuget package that contains a dependency on static code analyzers without introducing those analyzers into downstream projects?

$
0
0

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?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>