Search Wiki:
Resource Page Description
StyleCop analyzes C# source code to enforce a set of style and consistency rules. It can be run from inside of Visual Studio or integrated into an MSBuild project.

This release has been moved to

StyleCop has transitioned to an open source project and is now managed from The Discussion and Issue Tracker tabs has been hidden from this site. Please use the CodePlex site for all future discussions and issue tracking. This site will remain active for the time being as a download point for the StyleCop RTM release.

For more information about Microsoft StyleCop see the StyleCop blog at

Last edited Jun 2 2010 at 5:18 PM  by jasonall, version 12
BrentLamborn wrote  May 27 2008 at 4:30 PM  
Thanks a lot for this tool!

TATWORTH wrote  Aug 4 2008 at 12:16 PM  
Where is the promised version 4.3 that fixes the "COM object detached from RCW" error?

TATWORTH wrote  Aug 4 2008 at 12:45 PM  
When will Visual Studio generated code such as for unit tests be StyleCop compliant?

jasonall wrote  Aug 5 2008 at 6:15 PM  
We are currently finalizing the documentation for the 4.3 release and will get this release out to you as soon as we can get the docs published. Thanks for your patience.

TATWORTH wrote  Aug 13 2008 at 1:04 PM  
If the 4.3 has passed testing can we have it as install now? The inability of 4.2 to co-exist with ReSharper is major problem. Can you also give a copy of 4.3 to people at JetBrains so they can test it against ReSharper .

jasonall wrote  Aug 19 2008 at 3:23 PM  
StyleCop 4.3 has now been released on this site.

TATWORTH wrote  Aug 19 2008 at 6:14 PM  
There is a problem in upgrading from 4.2 to 4.3 in that only one version can be installed. The build path has changed in the project file from
<Import Project="$(ProgramFiles)\MSBuild\Microsoft\SourceAnalysis\v4.2\Microsoft.SourceAnalysis.targets" />
<Import Project="$(ProgramFiles)\MSBuild\Microsoft\StyleCop\v4.3\Microsoft.SourceAnalysis.targets" />

This requires a manual edit of the project file as it will not load until this path is modified.

Bo wrote  Aug 19 2008 at 9:03 PM  
Please use the "Discussions" or issues tab above for these kind of comments.

Cheetah wrote  Oct 23 2008 at 10:50 PM  
Woow, this is very very cool. The style it enforces is great and I'm going to force my colleage developers with a bad coding style to use this.

akutz wrote  Nov 3 2008 at 1:33 AM  
FYI - StyleCopCmd was released last week at StyleCopCmd provides a command line interface and NAnt task for interacting with StyleCop. StyleCopCmd also creates beautiful HTML reports, making it easy to integrate with continuous integration servers such as TeamCity.

JigarChhadwa wrote  Nov 20 2008 at 5:51 PM  
Great tool.. Just superb... :-)

daveschinkel wrote  Dec 6 2008 at 8:26 PM  
Someone mentioned wanting a VB Version. I'd like to see a VB Version that not only changes the style but converts the VB to C#! Wish VB never existed

BrankoRieck wrote  Dec 10 2008 at 10:17 AM  
@ daveschinkel
I am one of those, who want a VB Version! With quite the same right (actually NO right at all!) I could say the same thing about C#

I think it is an affront for all the millions of VB developpers, that so far not even an announcment has been made about a VB version.

rroman81 wrote  Dec 11 2008 at 2:39 AM  
any word on VB version? I'd definitely vote for a feature request.

BrankoRieck wrote  Dec 11 2008 at 3:26 PM  
I have to step back from my previous comment, because jasonall has given a very detailed explaination of the problems with a VB version, and an outlook in things to come. See for details!

Again, thanks jasonall!

dtinney wrote  Dec 18 2008 at 9:07 PM  
Does StyleCop work with all versions of Visual Studio (2003, 2005, 2008) ?

commodore73 wrote  Dec 24 2008 at 10:07 PM  
I think I found a defect. If my class has a property, and my class uses an object that has a property of the same name, StyleCop prompts me that my use of that property should begin with this. when it should not (it must begin with a reference to that object).

TheRubble wrote  Jan 15 2009 at 2:50 PM  
When is the website analysis fix going to be released? This is causing a right pain.

jasonall wrote  Mar 13 2009 at 4:16 PM  
@TheRubble: Web project issues have been fixed in, available now.

jasonall wrote  Mar 13 2009 at 4:16 PM  
@Dtinney: StyleCop 4.3 integrates into VS 2005 or newer.

hfrmobile wrote  Jun 26 2009 at 9:10 AM  
Thank you for that tool!

lbsa71 wrote  Sep 9 2009 at 6:36 AM  
I love this tool; and paired with StyleCop for ReSharper, this is just awesome.

HSchoefer wrote  Dec 1 2009 at 11:58 AM  
thank you very very much. really good tool

RajaG wrote  Jan 19 2010 at 7:27 PM  
We need a stylecop for C++ code as well. Do you have plans to develop one such tool/add that feature?

PLaurin wrote  May 6 2010 at 8:16 AM  
Open sourcing StyleCop is a really really good idea. Thx guys.

MojoCode wrote  Sep 23 2010 at 9:37 PM  
Feature request: provide a "fix it" function to let the user select all of the Stylecop warnings and fix in one scoop.

JeanMi50 wrote  Oct 25 2010 at 9:25 PM  
This tool is very interesting.
One question: how can we access to assembly attributes?
I searched many hours and not found the solution.
We have to use Token collection to search "Assembly" token?
Thanks for your response.

theBoringCoder wrote  Mar 18 2011 at 6:28 PM  
Great tool!

BUT...I'm running it against Massive ( and it erroneously reports a syntax error as a warning where the compiler reports no such error. The warning is:

Warning 1 SA0102: A syntax error has been discovered in file C:\Users\a7247\Documents\Visual Studio 2010\Projects\Massive Kata\Massive\Massive.cs on line 24. C:\Users\a7247\Documents\Visual Studio 2010\Projects\Massive Kata\Massive\Massive.cs 24 1

theBoringCoder wrote  Mar 18 2011 at 6:29 PM  
Forgot to mention, line 24 in my source file is the signature of the constructor for the DynamicModel class:

public DynamicModel(string connectionStringName = "", string tableName = "", string primaryKeyField = "")

Page view tracker