An implementation of StyleCop rules using the .NET Compiler Platform
C# PowerShell
vweijsters Merge pull request #2752 from sharwell/sequential-pool-testing
Avoid running object pool tests in parallel with other tests
Latest commit 74582de Aug 10, 2018

StyleCop Analyzers for the .NET Compiler Platform

NuGetNuGet Beta

Join the chat at

Build status

This repository contains an implementation of the StyleCop rules using the .NET Compiler Platform. Where possible, code fixes are also provided to simplify the process of correcting violations.

Using StyleCop.Analyzers

The preferable way to use the analyzers is to add the nuget package StyleCop.Analyzers to the project where you want to enforce StyleCop rules.

The severity of individual rules may be configured using rule set files in Visual Studio 2015 or newer. Settings.StyleCop is not supported, but a stylecop.json file may be used to customize the behavior of certain rules. See for more information.

For documentation and reasoning on the rules themselves, see the Documentation.

For users upgrading from StyleCop Classic, see for information about known differences which you may notice when switching to StyleCop Analyzers.


StyleCopAnalyzers can be installed using the NuGet command line or the NuGet Package Manager in Visual Studio 2015.

Install using the command line:

Install-Package StyleCop.Analyzers

Install using the package manager: Install via nuget

Team Considerations

If you use older versions of Visual Studio in addition to Visual Studio 2015 or Visual Studio 2017, you may still install these analyzers. They will be automatically disabled when you open the project back up in Visual Studio 2013 or earlier.


See Contributing

Current status

An up-to-date list of which StyleCop rules are implemented and which have code fixes can be found here.