Navigation:  StyleCop 4.3 > StyleCop 4.3 Rules > Documentation Rules >

SA1638: FileHeaderFileNameDocumentationMustMatchFileName

Previous pageReturn to chapter overviewNext page
StyleCop 4.3

Send comments on this topic.

SA1638: FileHeaderFileNameDocumentationMustMatchFileName
Glossary Item Box
TypeName

FileHeaderFileNameDocumentationMustMatchFileName

CheckId

SA1638

Category

Documentation Rules

 

Cause

The file tag within the file header at the top of a C# code file does not contain the name of the file.

Rule Description

A violation of this rule occurs when the file tag within the file header at the top of a C# file does not contain the name of the file. For example, consider a C# source file named File1.cs, with the following header:

//-----------------------------------------------------------------------

// <copyright file="File2.cs" company="Sprocket Enterprises">

//     Copyright (c) Sprocket Enterprises. All rights reserved.

// </copyright>

//-----------------------------------------------------------------------

 

A violation of this rule would occur, since the file tag does not contain the name of the file. The header should be written as:

//-----------------------------------------------------------------------

// <copyright file="File1.cs" company="Sprocket Enterprises">

//     Copyright (c) Sprocket Enterprises. All rights reserved.

// </copyright>

//-----------------------------------------------------------------------

 

How to Fix Violations

To fix a violation of this rule, add the name of the file to the file tag.

 


© Microsoft Corporation. All Rights Reserved.