-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
CA2208 Instantiate argument exceptions correctly #7187
Conversation
Build is failing on dependency microsoft.codeanalysis.collections:
|
Related Roslyn issue: |
So we're waiting for that issue to be resolved? That looks outside the MSBuild layer. |
Yes, I am not sure how to tell the analyzer not to analyze code like this. So I am attempting to fix the upstream code. |
@elachlan Those errors should be suppressible via editorconfig per dotnet/roslyn#55992, probably something like: [**/microsoft.codeanalysis.collections/**/*.cs]
# CA2208: Instantiate argument exceptions correctly
dotnet_diagnostic.CA2208.severity = none If it doesn't work (I haven't tested), then dotnet/roslyn#55992 should probably re-considered. FYI @jaredpar |
.editorconfig didn't work. But I don't think we are using IncludeContentInPack. |
@elachlan I can't think of how Since you can confirm that |
See the commit adding it here: |
@elachlan I'm referring to roslyn side, the package itself has its source code included in pack: That's why I think dotnet/roslyn#55992 is relevant. |
@sharwell in dotnet/roslyn#55992 it was pointed out that globalconfig defined analyzers apply to source code supplied by nuget packages as well. Where as .editorconfig files do not apply analyzers to against the packages. This means I will unfortunately need to move back to using .editorconfigs. Unless you know of a better way? |
Relates to #7174
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/CA2208