To activate this mode, add the following lines to your project analysis configuration file:
sonar.fxcop.mode=reuseReport sonar.gendarme.mode=reuseReport sonar.stylecop.mode=reuseReport
sonar.fxcop.assemblyDependencyDirectories property to a comma-separated list of paths patterns to locate the directories containing the dependency assemblies. Paths are relative to the folder folders containing the ".csproj" files.
How to not report issues on generated code?
sonar.stylecop.analyzers.settings property to the file that holds additional settings for StyleCop. The path is relative to the folder folders containing the ".csproj file" files.
This settings files will not be used to specify the active rules. Only settings such as "expected header contents", company names and so on will be used during the analysis.
This rule works at class level. If you are working on a Windows form or aspASP.net NET project, you may have many partial classes. The code generated in the "designer" parts may contain many "visible fields" whereas the real code that matters does not contain any defects. In order to avoid these false positives, you have two options:
- Disable this rule. Probably not the best option.
- Use the Switch Off Violations plugin to disable the rule only on "view" related components.
On an aspASP.net NET project you may configure the Switch Off violations plugin as follow: