C# Coding Guidelines (7) Tools

C# Coding Guidelines:

In this article some excellent tools for code quality will be introduced.

FxCop / Code Analysis

FxCop is standalone while Code Analysis is integrated in Visual Studio, but many developer do not quite care about it.

Its original purpose is programmatic enforcement of the Framework Design Guidelines. Applying Code Analysis in the daily coding will be helpful to build the habit of professional coding.

You can get a lot of useful information from the Code Analysis Team Blog.

StyleCop

Many people never used this tool. Personally I like it very much. StyleCop analyzes C# source code to enforce a set of style and consistency rules, which are customizable.

After the installation it can be integrated into Visual Studio:

image

You can download the latest version from here. And the StyleCop Team Blog is here.

Resharper + [StyleCop For Resharper]

Resharper is the most powerful plug-in for Visual Studio I have ever used. Its features include:

etc.

Itself also supports plug-ins, like this excellent StyleCop for ReSharper. After the installation, Visual Studio becomes like this:

image

The developer cannot get rid of even a slight coding style inconsistency.

And this is its Code Cleanup feature:

image

So many customizable rules make it incomparable with the Ctrl + K + D of Visual Studio.

GhostDoc

GhostDoc is a small plug-in of Visual Studio used to generate XML documentation comments. Using GhostDoc greatly saves a lot time.

Sandcastle

This is a toolkit for generating document from the XML comments in the code.

These are needed to install:

Then just:

  • import the solution;
  • customize the configurations;
  • build the document.

Then the MSDN-like document is built, which looks very professional. Here are some snapshots in part 6.

3 Comments

Comments have been disabled for this content.