Menu
In Visual Studio 2015, there are two available extensions: 'StyleCop' (by Chris Dahlberg) and 'Visual StyleCop' by Christophe Heiser. The number of reported downloads for 'StyleCop' are 28,267, but for 'Visual StyleCop', it's much higher at 81,914. StyleCop: A Detailed Guide to Using It in Visual Studio 2019, The merits of the above example are something to discuss with your team The stylecop.json file is a settings file to further configure StyleCop. StyleCop Settings Examples. So this is the place where the StyleCop.Analyzers package comes to the rescue for your style consistency. StyleCop.Analyzers NuGet package with ’editorconfig’ and ‘stylecop.json’ files. StyleCop.Analyzers package provides warnings that indicate style and consistency rule violations in C# code. StyleCop used to be a Visual Studio plugin and a NuGet package. You can still use this in Visual Studio 2019, but the current recommended way to use StyleCop is to use the Roslyn-based analyzers.
StyleCop analyzes C# source code to enforce a set of style and consistency rules. It is available in two primary forms: The StyleCop Visual Studio extension, which allows StyleCop analysis to be run on any file, project, or solution in Visual Studio without modifying the source code. Visual Studio 2010, 2012, 2013, 2015, 2017, and 2019 are.
NOTE: This project is no longer very active. See the 'Considerations' section below.
StyleCop analyzes C# source code to enforce a set of style and consistency rules. It is available in two primary forms:
- The StyleCop Visual Studio extension, which allows StyleCop analysis to be run on any file, project, or solution in Visual Studio without modifying the source code. Visual Studio 2010, 2012, 2013, 2015, 2017, and 2019 are supported by this extension.
- The StyleCop.MSBuild NuGet package, which allows StyleCop analysis to be added to any .NET 4.0+ project without installing anything else on the system.
There is also a ReSharper plugin that can be added using ReSharper's Extension Manager.
Considerations
While pull requests will continue to be accepted, it is unlikely that any major development (including support for newer C# syntax) will be done on this project. It is increasingly difficult and inefficient to maintain the custom C# parser used by StyleCop. The primary motivation for recent maintenance work was to allow developers who were already using StyleCop to upgrade to Visual Studio 2015 and C# 6.