Guy Barrette, Microsoft, Regional Director, Montreal, Canada, Visual Studio, .NET Expertise Microsoft Source Analysis for C# - Guy Barrette

Guy Barrette

Microsoft Regional Director, Montreal, Canada

Microsoft Source Analysis for C#

Microsoft released a new cool tool called Microsoft Source Analysis for C#.  It's an internal tool that does somewhat FxCop does.  While FxCop analyse the IL, Source Analysis analyse the source code itself.  It comes with about 200 built in rules that are however not customizable.  These rules cover:

  • Microsoft Layout of elements, statements, expressions, and query clauses
  • Placement of curly brackets, parenthesis, square brackets, etc
  • Spacing around keywords and operator symbols
  • Line spacing
  • Placement of method parameters within method declarations or method calls
  • Standard ordering of elements within a class
  • Formatting of documentation within element headers and file headers
  • Naming of elements, fields and variables
  • Use of the built-in types
  • Use of access modifiers
  • Allowed contents of files
  • Debugging text

After installation, the tool is integrated into the VS 2005 or 2008 IDE.  You can right click in the code window to analyse that code:

Or right click on the project name in the Solution Explorer to analyse the whole project:

From the same menu, you can change the tool's settings:

The results are displayed in the same area as the Output window:


You can read about Source Analysis for C# here:
http://blogs.msdn.com/sourceanalysis/

You can download it here:
http://code.msdn.microsoft.com/sourceanalysis/Release/ProjectReleases.aspx?ReleaseId=1047

 

Posted: May 25 2008, 07:46 PM by guybarrette | with 4 comment(s)
Filed under:

Comments

mathmax said:

I don't really understand what's this tool used for?

# May 26, 2008 7:57 AM

AndrewSeven said:

Is there a way to specify solution-wide settings insted of setting them on each project?

# May 26, 2008 10:48 AM

Gregor Suttie said:

Doesnt apear to do anything for asp.net website solutions.

# May 26, 2008 4:47 PM

Resolver said:

True, when i tried to execute it for ASP.NET website. The tool did not analyse any files. Anyone knows the reason ?

# June 2, 2008 9:58 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)