|
Send comments on this topic.
|
SA1123: DoNotPlaceRegionsWithinElements
|
Glossary Item Box
|
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.