You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can one configure the warnings?
Visual Studio 2017 provides no functionality to either run or configure Code Analysis at all and I can only get CA warnings when I build via command line due to #1117 . If there is no UI for it, at least some other way to configure it would be great.
The text was updated successfully, but these errors were encountered:
@ChristophB125 - FXCop analyzer can be added and configured for .NET core projects.
Install analyzers: You can add a nuget package reference to the analyzer package, and they should light up for your project.
Configure rules: You can manually add a CodeAnalysisRuleSet property to the project file and specify a ruleset that configures FXCop rules. You can also explicitly specify /warnaserror:<ruleId> or /nowarn:<ruleId> on the command line or specify these IDs in the Build property page to escalate/suppress warnings.
SuppressMessage: You can use regular SuppressMessageAttribute to suppress any analyzer warnings - if it doesn't work, kindly open an issue on https://github.com/dotnet/roslyn/issues/new
Thanks for the info.
I managed to get CA working, manually specify the ruleset in the csproj and also suppress some warnings either in code or ruleset file.
However, on .Net Core some CA warnings do not get triggered correctly (e.g. CA1012 does not get triggered and CA2213 gets triggered in a case where only CA1001 should have been triggered).
I created this and this issue for it.
Analyzer package
Microsoft.CodeAnalysis.FxCopAnalyzers (latest stable release 1.1.0)
Question
How can one configure the warnings?
Visual Studio 2017 provides no functionality to either run or configure Code Analysis at all and I can only get CA warnings when I build via command line due to #1117 . If there is no UI for it, at least some other way to configure it would be great.
The text was updated successfully, but these errors were encountered: