Navigation:  StyleCop 4.3 > StyleCop 4.3 Rules > Readability Rules >

SA1123: DoNotPlaceRegionsWithinElements

Previous pageReturn to chapter overviewNext page
StyleCop 4.3

Send comments on this topic.

SA1123: DoNotPlaceRegionsWithinElements

Glossary Item Box

TypeName
DoNotPlaceRegionsWithinElements

CheckId

SA1123

Category

Readability Rules

 

Cause

The C# code contains a region within the body of a code element.

Rule Description

A violation of this rule occurs whenever a region is placed within the body of a code element. In many editors, including Visual Studio, the region will appear collapsed by default, hiding the code within the region. It is generally a bad practice to hide code within the body of an element, as this can lead to bad decisions as the code is maintained over time.

How to Fix Violations

To fix a violation of this rule, remove the region from the code.

 


© Microsoft Corporation. All Rights Reserved.