-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Microsoft.VisualStudio.Threading analyzers leaking into consuming project #101
Comments
That doesn't address the same problem you're seeing and isn't extreme. It's necessary to prevent any dependencies in the analyzers from being exposed as nuget dependencies. Analyzers must be entirely self-contained, so any dependencies they have that aren't provided by the compiler must be bundled in the nuget package itself, and thus there is no need or desire to have the package itself express dependencies to support analyzers. The xml snippet you found prevents these dependencies from showing up in the package. It's entirely separate the problem you're facing, which is totally a legit complaint. Sadly, nuget doesn't support In the meantime, there are only two options:
|
FYI these "Visual Studio ones" are not specific to Visual Studio, and in fact many of them may be useful for most apps to have. In fact some of them are so generally interesting that the .NET SDK started porting them from the vs-threading analyzer library to the SDK a while back. That work was never finished, unfortunately. |
A bunch of
VSTHRD
warnings and errors appear in my project when I reference Nerdbank.MessagePack 0.2.34-alpha. I believe this is due to VS threading analyzers you use in the project.I was able to suppress them by doing
<ExcludeAssets>analyzers</ExcludeAssets>
on the Nerdbank.MessagePack<ProjectReference>
but this forced me to lift the dependency to all of my projects that transitively reference Nerdbank.MessagePack.I saw this approach in your code but this seems like a pretty extreme measure since I just want to suppress the VS Threading analyzer coming from Nerdbank.MessagePack.
Nerdbank.MessagePack/src/Analyzers.props
Lines 11 to 17 in ad761ab
Is this expected? Personally, I would expect MessagePack-related analyzers to run but not Visual Studio ones.
Right now, I preferred working around the problem by simply suppressing the message codes I didn't want, e.g.
The text was updated successfully, but these errors were encountered: