Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

Property Headers

By default StyleCop comes with two rules which govern the summary documentation for properties, depending upon the types of accessors contained with the property. For example: /// <summary> /// Gets or sets the name of the customer. /// </summary>
Posted by jasonall | (Comments Off)

Rule Suppressions

Starting with StyleCop 4.3.2, it is possible to suppress the reporting of rule violations by adding suppression attributes within the source code. The syntax for these suppressions is similar to that for Visual Studio Code Analysis, or FxCop. For more
Posted by jasonall | (Comments Off)

StyleCop update 4.3.2.1 is released

I am pleased to announce that we’re released another build of StyleCop which includes multiple bugfixes as well as one significant new feature, the ability to insert in-code rule suppressions using the same attribute syntax as FxCop Code Analysis. For
Posted by jasonall | (Comments Off)

StyleCop update 4.3.1.3 is released

We have just released an update to StyleCop 4.3 which contains a number of bugfixes as well as a small number of new features. In particular: Ability to use <include> tags within Xml header documentation to pull docs from external files. Get accessor
Posted by jasonall | 2 Comments

Introducing StyleCop on Legacy Projects

A number of people have asked for tips on rolling out StyleCop on a large, pre-existing codebase. This can prove challenging, since the tool will typically generate thousands of violations the first time it is run on existing code. For a large solution,
Posted by jasonall | 1 Comments

StyleCop 4.3 SDK

The SDK documentation for StyleCop 4.3 is now available for download, here: https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sourceanalysis&ReleaseId=1425 This documentation explains how to create and install custom StyleCop
Posted by jasonall | 4 Comments

StyleCop 4.2 MSBuild Integration

This article explains how to integrate the StyleCop tool into an MSBuild based build environment. This type of integration will cause the tool to run automatically whenever the code is built, and StyleCop violations will show up alongside compiler errors
Posted by jasonall | 3 Comments

StyleCop 4.3 Is Released

The awaited StyleCop 4.3 update is now available. This update includes: Various bugfixes, including fixes for VS integration issues Rules documentation is included and integrated into VS "Show Error Help" New rules (more detail below) Branding change
Posted by jasonall | 34 Comments

Clearing up Confusion

There has been some confusion and a few mixed messages coming out of Microsoft since the release of StyleCop, most notably around extensibility support for the tool, and licensing. We've gotten a lot of great feedback from the community, and in the last
Posted by jasonall | 4 Comments

Configuring Hungarian Notation Rules

By default, Microsoft StyleCop does not allow variable or field names to include Hungarian notation. This is enforced by rule SA1305, FieldNamesMustNotUseHungarianNotation. The implementation of this rule is rather straightforward, assuming that any field
Posted by jasonall | (Comments Off)

Configuring Results Cache Settings

Each time StyleCop is run, it will cache the results of the analysis onto the disk. The next time StyleCop is run on the same project or file, the tool will determine whether any changes have occured within the file since the last analysis. If not, the
Posted by jasonall | (Comments Off)

Configuring File Header Company and Copyright

It is possible to control the company name and copyright text that is required within the file header at the top of every C# source file. A typical file header looks like the following: //-----------------------------------------------------------------------
Posted by jasonall | (Comments Off)

A Brief History Of C# Style

A number of astute developers have noted that the C# code style enforced by Microsoft StyleCop differs in some ways from the style typically seen in sample code coming from the Microsoft Developer Division. For example, the very fine book Framework Design
Posted by jasonall | 34 Comments

Sharing StyleCop Settings Across Projects

By default, StyleCop configuration settings are applied on a project by project basis. In a standard installation, each project folder will contain a Settings.SourceAnalysis file, describing the settings for this project. In cases where the default settings
Posted by jasonall | (Comments Off)

Enabling or Disabling StyleCop Rules

It is possible to enable or disable individual StyleCop rules at the project level. First, read this article to learn how to bring up the settings dialog for a particular project. Bring up the settings dialog for a particular project, and select the Rules
Posted by jasonall | (Comments Off)
More Posts Next page »
 
Page view tracker