Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "File has no header" build warning in visual studio mean

I'm building my project fine but two of the files in my unit test project give a build warning "File has no header." they're unrelated and otherwise unremarkable .cs files. I've googled but get swamped with results for "SA1633: The file has no header, the header Xml is invalid, or the header is not ...."

These warnings do not have an error code, what could they mean?

like image 624
dibs487 Avatar asked Oct 22 '25 13:10

dibs487


1 Answers

That´s a StyleCop code analysis violation.

This means that a C# source file is missing a file header.

The file header must begin on the first line of the file and must be formatted as a block of comments containing Xml, as follows:

//-----------------------------------------------------------------------
// <copyright file="NameOfFile.cs" company="CompanyName">
//     Company copyright tag.
// </copyright>
//-----------------------------------------------------------------------
like image 79
k7s5a Avatar answered Oct 25 '25 03:10

k7s5a