Table of Contents

SA0002: Invalid settings file

📝 This rule is new for StyleCop Analyzers, and was not present in StyleCop Classic.

Cause

The stylecop.json settings file could not be loaded due to a deserialization error.

Rule description

This rule reports cases where the StyleCop Analyzers settings file could not be loaded. When this occurs, the various analyzers automatically fall back to using the default settings, which may not match the user's expectations.

How to fix violations

To fix a violation of this rule, start by checking the following items:

  • Ensure stylecop.json contains valid JSON syntax. The file may be opened in Visual Studio 2015 to check for common errors (they are reported by the IDE in the Errors window).
  • Review the configuration documentation and ensure the contents of stylecop.json contain valid settings.

How to suppress violations

This warning can only be suppressed by disabling the warning in the ruleset file for the project.