Send comments on this topic. |
|
Cause
Rule Description
private void Method1()
{
//A single-line comment.
// A single-line comment.
}
The comments should begin with a single space after the leading forward slashes:
private void Method1()
{
// A single-line comment.
// A single-line comment.
}
An exception to this rule occurs when the comment is being used to comment out a line of code. In this case, the space can be omitted if the comment begins with four forward slashes to indicate out-commented code. For example:
private void Method1()
{
////int x = 2;
////return x;
}
How to Fix Violations
© Microsoft Corporation. All Rights Reserved.