MSDN Archive Home
Help and FAQs
All Resource Updates
Change History (all pages)
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 http://stylecop.codeplex.com/releases/view/48036.
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 22.214.171.124 RTM release.
For more information about Microsoft StyleCop see the StyleCop blog at
Jun 2 2010 at 5:18 PM
, version 12
May 27 2008 at 4:30 PM
Thanks a lot for this tool!
Aug 4 2008 at 12:16 PM
Where is the promised version 4.3 that fixes the "COM object detached from RCW" error?
Aug 4 2008 at 12:45 PM
When will Visual Studio generated code such as for unit tests be StyleCop compliant?
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.
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 .
Aug 19 2008 at 3:23 PM
StyleCop 4.3 has now been released on this site.
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.
Aug 19 2008 at 9:03 PM
Please use the "Discussions" or issues tab above for these kind of comments.
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.
Nov 3 2008 at 1:33 AM
FYI - StyleCopCmd was released last week at http://stylecopcmd.sourceforge.net/. 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.
Nov 20 2008 at 5:51 PM
Great tool.. Just superb... :-)
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
Dec 10 2008 at 10:17 AM
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.
Dec 11 2008 at 2:39 AM
any word on VB version? I'd definitely vote for a feature request.
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 http://code.msdn.microsoft.com/sourceanalysis/Thread/View.aspx?ThreadId=383 for details!
Again, thanks jasonall!
Dec 18 2008 at 9:07 PM
Does StyleCop work with all versions of Visual Studio (2003, 2005, 2008) ?
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).
Jan 15 2009 at 2:50 PM
When is the website analysis fix going to be released? This is causing a right pain.
Mar 13 2009 at 4:16 PM
@TheRubble: Web project issues have been fixed in 126.96.36.199, available now.
Mar 13 2009 at 4:16 PM
@Dtinney: StyleCop 4.3 integrates into VS 2005 or newer.
Jun 26 2009 at 9:10 AM
Thank you for that tool!
Sep 9 2009 at 6:36 AM
I love this tool; and paired with StyleCop for ReSharper, this is just awesome.
Dec 1 2009 at 11:58 AM
thank you very very much. really good tool
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?
May 6 2010 at 8:16 AM
Open sourcing StyleCop is a really really good idea. Thx guys.
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.
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.
Mar 18 2011 at 6:28 PM
BUT...I'm running it against Massive (https://github.com/robconery/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
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 = "")
Sign in to add a comment
Mon Aug 10 2009 at 7:00 AM
More Tags ...
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Manage Your Profile
MSDN Flash Newsletter
© 2008 Microsoft Corporation. All rights reserved.