Skip to content
ptittof57 edited this page Aug 15, 2015 · 5 revisions
<title>SA1638: FileHeaderFileNameDocumentationMustMatchFileName</title> <script src="script/helpstudio.js" type="text/javascript"></script> <script src="script/StandardText.js" type="text/jscript"></script>
<script type="text/jscript">WritePageTop(document.title);</script>

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="My Company">

// Custom company copyright tag.

// </copyright>

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

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

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

// <copyright file="File1.cs" company="My Company">

// Custom company copyright tag.

// </copyright>

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

How to Fix Violations

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

How to Suppress Violations

[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1638:FileHeaderFileNameDocumentationMustMatchFileName", Justification = "Reviewed.")]
Clone this wiki locally